473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Subtotal Line

6
I am trying to get subtotals by date to appear after all items for that date have been completed..for example

07/29/2007 SHOES 225
07/29/2007 BOXES 350
07/18/2007 SOCKS 2500
07/08/2007 LACES 500

right now I am getting the total at the bottom of my asp page

07/29/2007 575
07/18/2007 2500
07/08/2007 500

instead of after each date completion
07/29/2007 SHOES 225
07/29/2007 BOXES 350
TOTAL: 575
07/18/2007 SOCKS 2500
TOTAL: 2500
07/08/2007 LACES 500
TOTAL: 500

Can someone point me in the right direction?
Sep 19 '07 #1
6 1690
jhardman
3,406 Expert 2GB
Show your code. How are you making the totals now?

Jared
Sep 20 '07 #2
char
6
Expand|Select|Wrap|Line Numbers
  1. MySQL = "SELECT * FROM ReportSummary (NOLOCK)"
  2. MyRecordSet.OPEN MySQL, XXXXX
  3. MyArray = MyRecordSet.GETROWS()
  4. MyRecordSet.CLOSE
  5. FOR MyCursor = LBOUND(MyArray,2) TO UBOUND(MyArray,2)
  6. body = body + "<TR><TD BGCOLOR=""" & SHADE & """><B>" & "&nbsp;</TD><TD BGCOLOR=""" & SHADE & """><B>" & "</TD><TD BGCOLOR=""" & SHADE & """><B>" & "&nbsp;</TD><TD COLSPAN=4 BGCOLOR=""" & SHADE & """><B>"& MyArray(0,MyCursor) & "</TD><TD ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """><B>" & MyArray(1,MyCursor) & "</TD><TD ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """><B>" & MyArray(2,MyCursor) & "</TD><TD ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """><B>" & MyArray(3,MyCursor) & "</TD><TD ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """><B>" & MyArray(4,MyCursor) & "</TD><TD BGCOLOR=""" & SHADE & """>"& "</TD><TD ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """></TD></TR>" & vbcrlf
  7. IF SHADE = "#FFFFFF" THEN SHADE = "#DDDDDD" ELSE SHADE = "#FFFFFF"
My totals are coming up at the end of the asp page instead of after each date.
Sep 20 '07 #3
jhardman
3,406 Expert 2GB
hmm. This doesn't look like it has the code that calculates the totals. Is that just being calculated in the db?

Jared
Sep 20 '07 #4
char
6
Yes, it is calculated in the db. I am very new at creating asp classic and this was given to me without any training. I appreciate your help.
Sep 24 '07 #5
jhardman
3,406 Expert 2GB
The thing is your ASP script just opens up the report and prints it out with a little formatting (gives alternating colors for each row). If you want to do this the same way (without re-writing the script) you would just need to go into the db manager and edit how the report is made there.

On the other hand, I usually make the report in the script, so I like to open up the raw data and add up all the totals in the ASP page. I guess what I am trying to say is you have the choice and you should choose based on which you feel more comfortable messing with. Does that make sense?

Jared
Sep 24 '07 #6
char
6
Yes...thank you for all your help.
Sep 25 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: J. T. | last post by:
I'm fairly new to XSL, but have made some good progress in picking it up for the project I'm currently working on. I've been trying to figure out how to design a stylesheet that would transform...
7
by: GaryB | last post by:
I have an untyped datatable that has financial numbers and controls that were populated by code (not a simple fill from a DA). Now I want to insert subtotals into it. I wrote a sub to do so that...
2
by: Sparky Arbuckle | last post by:
Hello All! My problem is trying to calculate SubTotal in my FOR EACH NEXT Loop. I am looping through depending on how many of each different item is in the user's shopping cart. I am using each...
3
by: xian2 | last post by:
Hi All, I am trying to create a subtotal text box much like the one in the orders form of the northwind database where you have a subtotal text box in the footer of the subform and then have that...
5
by: mebrabham | last post by:
Hello, I am trying to create a running subtotal in a query and then graph the running subtotal for each city group. The data looks like this in the table (for illustration): My City My...
2
by: mouac01 | last post by:
I have this array: How would I get the subtotal of each acct so that total for A1 dr/cr is 400 and total for A2 dr/cr is 600. TIA...
1
by: tam76131 | last post by:
Hello, I'm very new to access and have been struggling with the subtotal function in access. I have a very large table with the following info State City ID Month ...
1
by: eskelies | last post by:
Hello all, Does anyone have any code that will subtotal a query in Access? Thank you. BEFORE: Account Code Principal Income 4 BUY $10.00 $0.00 4 BUY $10.00 $0.00
2
by: murch.alexander | last post by:
Hi all, I have a query that uses a subquery to subtotal one of its fields. This part is working fine. The twist is that when I encounter certain values, I want to reset the subtotal to zero and...
12
by: etmanage | last post by:
I have a subform that totals a subtotal in the form footer. It works fine. I then pull that value onto the main form into a textbox called Subtotal2 by setting the control source...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.