Sir, I have these PHP codes
while($res = sqlsrv_fetch_array($result)) {
echo "<tr>";
$sno=$sno+1;
echo "<td align='center'>$sno</td>";
echo "<td align='center'>".($res['acc_code'])."</td>";
$partycode=($res['acc_code']);
$query1 = "select code,desc1 from master where code='".$partycode."'";
$result1 = sqlsrv_query($con,$query1) or die ("Error". sqlsrv_errors($con)) ;
while($res1 = sqlsrv_fetch_array($result1)) {
echo "<td align='left' class='color1'>".($res1['desc1'])."</td>";
}
echo "<td align='right'>".($res['dr_amount'] != 0 ? number_format(abs($res['dr_amount'])):'')."</td>";
echo "<td align='right'>".($res['cr_amount'] != 0 ? number_format(abs($res['cr_amount'])):'')."</td>";
}
The query generates this result
But I need this result
I mean the sum of all 7 digit code to 4 digit codes like shown in red square.
Please help