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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries and Sums

Status
Not open for further replies.

mrchinchin25

IS-IT--Management
Oct 10, 2002
15
GB

If I have a query that is returning the following fields:
Part No,
Demand*Setup

how can I get the Sum of Demand*Setup for different Part No.s???

eg.

Part No Demand*Setup Part Total
X 4 6
X 2 6
Y 6 8
Y 2 8

ie. Part No X has a total of 6.
Part No Y has a total of 8.

DSum is just going to bring back the entire sum of the query (in this case 6+6+8+8 = 28).

any ideas???

 
If I understand this correctly.....

Can you base another query off your current query and just use the totals:

Part No - Group By
Demand*Setup - Sum

Would that work for you?

Fred
 
Hi!

Use the following SQL:

Select [Part No], Sum([Demand*Setup]) As SetupTotal From YourTable Group By [Part No]

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top