Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 17th, 2007, 12:23 PM
Authorized User
Points: 292, Level: 5
Points: 292, Level: 5 Points: 292, Level: 5 Points: 292, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Math Functions on dynamic data

I have an .asp page that has a repeat region. This region includes dynamic data of item costs. Is there a tutorial anywhere or can someone tell me how to add these costs?

Example: Someone searches for everything purchased on today's date:

     Lipstick $ 5.10
     Eye Shadow 2.15
     Eye Shadow 2.15

How can I get this dynamic report to total the column?

I'm sorry to post here if this is considered an "advanced" issue. But I still consider myself a beginner. Thanks in advance for any and all help. :)
Reply With Quote
  #2 (permalink)  
Old January 17th, 2007, 02:08 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The psuedo code would be something like

Dim dblResult
for each row in recordset
   dblResult = dblResult + recordset("pricecolumn")
Next

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========
Reply With Quote
  #3 (permalink)  
Old January 23rd, 2007, 12:01 PM
Authorized User
Points: 292, Level: 5
Points: 292, Level: 5 Points: 292, Level: 5 Points: 292, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Would that go into the header or into the body?

Thanks!
Reply With Quote
  #4 (permalink)  
Old January 23rd, 2007, 12:07 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

...I have no idea where you would put it in your code. If you are placing this just somewhere on your page you can put it anywhere before the page renders and then just do this on your page:

<%=dblResult%>

(Remember to format it as currency)

Alternatively, you could simply write a query to figure the total for you. The query language would be something like:

SELECT Sum(priceColumn) from table [where clause]

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
string to x-path - EXSLT - dynamic functions Geierwally XSLT 1 July 12th, 2007 10:35 AM
Getting percentages with math functions tslag XSLT 1 June 22nd, 2006 11:47 AM
Graphics Math Functions vb certified Pro VB.NET 2002/2003 2 January 1st, 2006 11:06 AM
Math functions-Please help! jroxit ASP.NET 2.0 Basics 5 December 28th, 2005 12:21 PM
Why are my math functions not being included? jkeen BOOK Beginning Linux Programming, 3rd Edition 4 October 22nd, 2004 05:29 AM



All times are GMT -4. The time now is 06:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.