Forums

ASP

This topic is locked

adding the result of a recordset

Posted 16 Jan 2006 18:36:16
1
has voted
16 Jan 2006 18:36:16 Javier Castro posted:
I have two recordsets:

<%=(rsSub2.Fields.Item("subtotal".Value)%> and <%=(rsTest.Fields.Item("subTaxes".Value)%> that I want to calculate.
My simplistic version would be:

<%=(rsSub2.Fields.Item("subtotal".Value)%> * <%=(rsTest.Fields.Item("subTaxes".Value)%> /100 = total

I have no clue how to do this using ASP, I have been trying to do it using SQL, but I haven't been able to succeed and as someone told me, since I'm using an Access Database, if I do my calculation via Queries, I would pay with processing load. Please, if anyone has a sample of how to approach such calculation using ASP would be great. Is it possible.? Any idea, suggestion? I am more of a front end guy but I'm trying to learn the back end.

Replies

Replied 20 Jan 2006 06:00:05
20 Jan 2006 06:00:05 Wim Conix replied:
Javier,

Try this :

<%=(rsSub2.Fields.Item("subtotal".Value) * (rsTest.Fields.Item("subTaxes".Value) /100%>

That's all, this makes the calculation in ASP, without having to query in Access, which will work much slower indeed.

Greetz,

Wim
Replied 22 Jan 2006 17:27:08
22 Jan 2006 17:27:08 Javier Castro replied:
Thanks for the reply Wim, I finally got to do it. And yes it is as you suggest.
Cheers,

Javier

Reply to this topic