Skip to main content
July 19, 2011
Question

Repeat region - calculation (ASP)

hi all, i need help from you all

i have a problem as like...

i create db_ewallet (debit,credit,userid)

#########################

#  userid   #  debit  #  credit  #

#-------------#------------#------------#

# John     #   $20    #   $5     #

# John     #   $12   #            #

# Ray      #   $22   #    $12   #

# Lynda   #   $28   #    $3    #

#             #           #            #

#########################

i create table and make repeat region (user id is unique id)

the problem is i cant make a calculation total of debit because John (same people)

the command like this :to calculate debit

<%=(debit.Fields.Item("john").Value) + (debit.Fields.Item("Ray").Value)+ (debit.Fields.Item("lynda").Value)%>

the result appear = $70, the result should be like this : $82

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Participating Frequently
July 19, 2011

Simple. In your loop that outputs the recordset, maintain two variables that accumulate the debt and credit values.

I'm confused with your code though. Do you actually have database columns named 'Ray' , etc?

If you need more help, then you need to supply more info; database design, ASP code, etc.

Translate