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

Problems with summarising data in a parameter query

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Please help!!

I am having problems with a paramter query I have created. The query correctly prompts for a start and end date. What then happens is that it displays total costs information and the number of records (using the count function) for each individual record over that time period.

What I want to happen is that it just displays the total costs and number of records for all the records within the time period specified - in effect 1 record or row of summary information.

Any ideas would be gratefully received!

Rgds, LL

P.S. don't know if this helps, but here is the SQL for the query:

SELECT ESS_tbl.[Won, Pending or Lost], ESS_tbl.Date, Sum(ESS_tbl.[Estimate Value]) AS [SumOfEstimate Value], Count(ESS_tbl.[Won, Pending or Lost]) AS [CountOfWon, Pending or Lost]
FROM ESS_tbl
GROUP BY ESS_tbl.[Won, Pending or Lost], ESS_tbl.Date
HAVING (((ESS_tbl.[Won, Pending or Lost])="won") AND ((ESS_tbl.Date) Like "??/??/?0" And (ESS_tbl.Date) Between [Please enter start date] And [Please enter end date]));
 
Lozza,
Remove the date from the 'group by' clause, it should be a 'where' clause only, from what you say. If you want to show the dates, then use the *identical* parameters in an 'expression' , and the date range will show ie:
"Range " & [Please enter start date] & " to " & [Please enter end date] AS Expr1
--Jim
 
Brilliant - you've solved my problem. I never knew 'where' existed so I shall have to research it.

Thanks a million Jim!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top