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

Sum a Group By Sum Field

Status
Not open for further replies.

adrianvasile

Technical User
Apr 3, 2006
124
US
I have a simple query that manages some pricing information and I will need to have a total of a Group By Sum field.
Basically it will list each price that an item had, the cost associated and the quantity sold. I will use a Group by Sum for the Qunatity to get the total quantity for each change in price - but then I will need the total items sold.
Is this possible?
Thank you.
 




Hi,

The your agregator is COUNT...
Code:
Select Count(*), [SumField] 
From [YourTable] 
Group By [SumField]


Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 



Right click in the grid and select TOTALS.

Drag your sum field into the grid and select GroupBy in the TOTAL row.

Drag the field you want to count and select COUNT in the TOTAL row.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 



...oops

in the SECOND field...

enter Count(*)

and in the TOTALS row select expression

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I will try it and let you know.
Few minutes please.
Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top