...

View Full Version : looping



NiZAM
07-11-2007, 11:17 AM
okay, i have this..

<tr class="12">
<td width="3%"><?php echo $var_i ?></td>
<td width="3%" height="30" ><?php echo $rs_hptrx_link->Fields('emp_Id');?></td>
<td width="9%" ><?php echo $rs_hptrx_link->Fields('emp_Name'); ?></td>
<td width="5%"><?php echo $rs_hptrx_link->Fields('TRX_DATE'); ?></td>
<td width="5%"><?php echo $rs_hptrx_link->Fields('TRX_CODE'); ?></td>
<td width="7%"><?php echo $rs_hptrx_link->Fields('AMOUNT'); ?></td>

my problem is, how can i calculate the AMOUNT value for each TRX_CODE type and display the value inside the table. can anybody help me??please..

devinemke
07-11-2007, 04:08 PM
you already have a field called "amount". what other calculation is required?

NiZAM
07-12-2007, 02:51 AM
i need to calculate the total_amount for each TRX_CODE. Let say TRX_CODE is OT1,OT2,OT3,OT4,...i need to calculate and display the total amount for each amount of the TRX_CODE.

mlseim
07-12-2007, 03:24 PM
What kind of database is all of the stuff coming from?

daveyand
07-12-2007, 06:09 PM
you should be able to just have a counter. That increments as you loop iot.

But you might be able to do some of this through the database stuff.

paulyu
07-24-2007, 04:32 AM
i need to calculate the total_amount for each TRX_CODE. Let say TRX_CODE is OT1,OT2,OT3,OT4,...i need to calculate and display the total amount for each amount of the TRX_CODE.

Hi NiZAM,
An easy way to do it is to calculate the sum of [AMOUNT] by modifying same sql statement you used to get the data for your table.

Hope this help ! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum