Forum Moderators: open

Message Too Old, No Replies

Adding the total cost of price from a recorset?

         

Andrew Thomas

12:57 pm on May 7, 2003 (gmt 0)

10+ Year Member



I need to add the total cost of products from a recordset, could be any number of products and display the total price

rs_selected.Fields.Item("Prem_Price").Value

Ive tried different ways, but keep getting a 0 for my efforts.

Does any one have any ideas - though this was a simple problem, but cant get anywhere :(

aspdaddy

1:03 pm on May 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried :

rs_selected.MoveFirst
while not rs_selected.eof
total=total+Clng(rs_selected("Prem_Price"))
wend
Response.write total

Andrew Thomas

1:18 pm on May 7, 2003 (gmt 0)

10+ Year Member



Thanks - it worked,

i was leaving the Clng out

Andy