Cash Book Report
<p>I use this code for generating Daily Cash Book, it generates single report between starting and ending date but I want to generate
or fetch data date wise, or 1st May report generate separately then 2nd May and so on.</p>

<pre><code>&lt;?php
include'connect.php';
$Receipts = mysql_query("SELECT vou_date, vou_no, acc_code, acc_name, narration,  ROUND(SUM(receipts),2) AS receipts FROM cash_book WHERE vou_date BETWEEN '2013-05-01' AND  '2013-05-29' AND receipts &gt; 0 AND vou_no LIKE 'CR' GROUP BY acc_code");
while($CBResult = mysql_fetch_assoc($Receipts)){
echo '
    &lt;table border="0" width="900" align="center"&gt;
    &lt;tr&gt;
        &lt;td scope="col" width="100" align="center"&gt;'.$CBResult['vou_no'].'&lt;/td&gt;
        &lt;td scope="col" width="100" align="center"&gt;'.$CBResult['acc_code'].'&lt;/td&gt;
        &lt;td scope="col" width="200" align="left"&gt;'.$CBResult['acc_name'].'&lt;/td&gt;
        &lt;td scope="col" width="400" align="left"&gt;'.$CBResult['narration'].'&lt;/td&gt;
        &lt;td scope="col" width="100" align="right"&gt;'.$CBResult['receipts'].'&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
'; 
}
$Payments = mysql_query("SELECT vou_date, vou_no, acc_code, acc_name, narration,  ROUND(SUM(payments),2) AS payments FROM cash_book WHERE vou_date BETWEEN '2013-05-01' AND '2013-05-29' AND payments &gt; 0 AND vou_no LIKE 'CP' GROUP BY acc_code");
while($CBResult = mysql_fetch_assoc($Payments)){
echo '
    &lt;table border="0" width="900" align="center"&gt;
    &lt;tr&gt;
        &lt;td scope="col" width="100" align="center"&gt;'.$CBResult['vou_no'].'&lt;/td&gt;
        &lt;td scope="col" width="100" align="center"&gt;'.$CBResult['acc_code'].'&lt;/td&gt;
        &lt;td scope="col" width="200" align="left"&gt;'.$CBResult['acc_name'].'&lt;/td&gt;
        &lt;td scope="col" width="400" align="left"&gt;'.$CBResult['narration'].'&lt;/td&gt;
        &lt;td scope="col" width="100" align="right"&gt;'.$CBResult['receipts'].'&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
';
}
?&gt;
</code></pre>
