SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 11th, 2004, 10:02 PM
Scorcel Scorcel is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 Scorcel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face Resetting Running Total

Anybody please help me create a query that would return this expected output. Any help would be very much appreciated. I was able to do the Totalized Per PO already, but having hard time creating the Totalized PerBox.
Thank you very much!
Date QTY Box Number Box Code PONumber Totalized PerBox Totalized Per PO
1/1/04 10 1 A 01 10 10
1/2/04 15 2 A 01 25 25
1/3/04 20 3 A 01 45 45
1/4/04 10 1 B 01 10 55
1/5/04 20 2 B 01 30 75
1/6/04 15 3 B 01 45 90


Please bear with me, the expected output I pasted doest seem to show as it should be, It removed the spaces within values.


Reply With Quote
  #2  
Old August 12th, 2004, 03:01 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Which DB are you trying to do this in.

If you have MS Access you can fo to there knowledge base and dowloard a sample query DB called

QrySmp00.exe

It has several sample querys (SQL is fairly standard) that show you have running totals, all you would have to add is the ability to distingiush between POs and boxes (which won't be to hard).

S-

Reply With Quote
  #3  
Old August 13th, 2004, 08:44 PM
Scorcel Scorcel is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 Scorcel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks so much for the Reply. Yes I was able to download the sample query in Access. There were many sample queries, but none of the examples shows what I want to do.
I want to have a running total that would "reset" when my keyField changes.
Example:
Date QTY Box Number Box Code PONumber Totalized PerBox Totalized Per PO
1/1/04 10 -----1 --------A------- 01 ----------10 -------------10
1/2/04 15 -----2 --------A -------01 ----------25 -------------25
1/3/04 20 -----3 --------A -------01 ----------45 -------------45
1/4/04 10 -----1 --------B -------01 ----------10 -------------55
1/5/04 20 -----2 --------B -------01 ----------30 -------------75
1/6/04 15 -----3 --------B -------01 ----------45 -------------90
Note: For the whole PO the Totalized per PO would continue to do running Total; while the Totalized per box would reset count on the New Box Code.
Thanks again for your help.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Resetting Running Total


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT