Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "Summing for each group only" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). Visit the ASP Development forum for help with ASP/VBScript and ASP/JScript applications.


Closed Thread
 
LinkBack Thread Tools Display Modes
  #11  
Old June 5th, 2008, 10:51 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

ok, i used the solution from Mehere to get my category totals but i've been trying to get this data at the bottom but with no success so now I'd like to put these category totals into another table at the top of the screen.

I've created a table but it only lists the first category name and the total is not correct. Is there a way to use the same recordset and loop thru the records to get the category(s) and their total(s) in one table then go on to display the detail data (category, group, item, cost, etc) in another table?

ex: right now it looks like this
CategoryName1-GroupName1
--Item1-----Cost
--Item2-----Cost
-GroupName2
--Item3-----Cost
--Item4-----Cost
CategoryName1 Total--CategoryCost

CategoryName2-GroupName3
--Item5-----Cost
-GroupName4
--Item6-----Cost
CategoryName2 Total--CategoryCost

GrandTotal---------GrandTotalCost

Would like to make another table at the top of the screen to display like:
first table layout
CategoryName1 Total--CategoryCost
CategoryName2 Total--CategoryCost

ETC
GrandTotal---------GrandTotalCost

then second table layout
CategoryName1-GroupName1
--Item1-----Cost
--Item2-----Cost
-GroupName2
--Item3-----Cost
--Item4-----Cost
CategoryName1 Total--CategoryCost

CategoryName2-GroupName3
--Item5-----Cost
-GroupName4
--Item6-----Cost
CategoryName2 Total--CategoryCost
etc

CategoryName1 Total--CategoryCost
CategoryName2 Total--CategoryCost
GrandTotal---------GrandTotalCost
Sponsored Links
  #12  
Old June 5th, 2008, 11:11 AM
mehere's Avatar
Super Sarcasm Mistress
 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 161
Thanks: 12
Thanked 29 Times in 27 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

you can still use part of the other code (the part that does the total) for the top table ... to get the grand total ... you need to add another variable that keeps adding up all the values. once that's done, use the rs.MoveFirst (will take you back to the beginning of the recordset) and start the second table.
__________________
Quote of the Month:
Quality: The race for quality has no finish line- so technically, it's more like a death march.

Questions to Ponder:
What do you do when you see an endangered animal eating an endangered plant?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69
The Following User Says Thank You to mehere For This Useful Post:
Rebelle (June 5th, 2008)
  #13  
Old June 5th, 2008, 11:50 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

Quote:
Originally Posted by mehere View Post
you can still use part of the other code (the part that does the total) for the top table ... to get the grand total ... you need to add another variable that keeps adding up all the values. once that's done, use the rs.MoveFirst (will take you back to the beginning of the recordset) and start the second table.
Ahhh....Thanks again Mehere!!! I got the top table now!!! I'm still a newbie, so i never had to use rs.movefirst but now i know. Cheers! Gonna see if this will work for my second table (bottom category totals). You're the best!!!

heck ya!!! it worked for the bottom too! so awesome!

Last edited by Rebelle; June 5th, 2008 at 11:56 AM.
  #14  
Old June 5th, 2008, 01:22 PM
mehere's Avatar
Super Sarcasm Mistress
 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 161
Thanks: 12
Thanked 29 Times in 27 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

np ... glad it worked for you
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 10:22 AM.



Content Relevant URLs by vBSEO 3.2.0