Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiplying two fields and Insert result into table

Status
Not open for further replies.

MONFU

Programmer
Oct 27, 2001
35
MT
I am trying to do a small on-line store and I managed to insert the Quantity the user orders into a database. Now what I want it to multiply the Quantity and the Price list and get a Sub Total result and inserting it into the database. Can you please help me cause I am lost?

Thanks very much!
 
Well, that's a tricky question for us here because only you and God knows how you've designed your online store.

If you're problem is the math, you may need to convert your strings to numbers before the math will work.
Code:
<%
dim subTotal
subTotal = CLng(Request.Form(&quot;quantity&quot;)) * CLng(Request.Form(&quot;price&quot;))
%>

If you're problem is deeper than that, you're going to have to be a little more specific on your question.

Hope this helps ??

ToddWW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top