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

simple summary query solution needed

Status
Not open for further replies.

johnmaio

Programmer
Oct 22, 2002
3
US
i am totaling the number of tickets sold by date and have used the simple query wizard to give me summmary data...but it keeps asking me to enter parameter value for each field before it gives me the info i want.....how do i make it just open up to the results

here is the sql it wrote...any help would be grand !!!

SELECT DISTINCTROW Customers.PerformanceDt, Sum(Customers.SeniorStudentTix) AS [Sum Of SeniorStudentTix], Sum(Customers.RegularTix) AS [Sum Of RegularTix], Sum(Customers.GroupTix) AS [Sum Of GroupTix], Sum(Customers.CompTix) AS [Sum Of CompTix], Sum(Customers.SeasonTixUsed) AS [Sum Of SeasonTixUsed], [Sum Of SeniorStudentTix]+[Sum Of RegularTix]+[Sum Of GroupTix]+[Sum Of SeasonTixUsed]+[Sum Of CompTix] AS Expr1
FROM Customers
GROUP BY Customers.PerformanceDt, [Sum Of SeniorStudentTix]+[Sum Of RegularTix]+[Sum Of GroupTix]+[Sum Of SeasonTixUsed]+[Sum Of CompTix]
HAVING (((Customers.PerformanceDt) Is Not Null))
ORDER BY Customers.PerformanceDt;
 
I believe your GroupBy is incorrect:

GROUP BY Customers.PerformanceDt, [Sum Of SeniorStudentTix]+[Sum Of RegularTix]+[Sum Of GroupTix]+[Sum Of SeasonTixUsed]+[Sum Of CompTix]

You are referencing the assigned name of the column from your aggregate sums from your select. Try using the following:

GROUP BY Customers.PerformanceDt, Sum(Customers.SeniorStudentTix) + Sum(Customers.RegularTix) + Sum(Customers.GroupTix) + Sum(Customers.SeasonTixUsed) + Sum(Customers.CompTix)

The Group By was prompting you for an unknown value as it seems to not recognized the assigned name of the column at the time the GroupBy is being assessed. Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top