Re: Error message on Where statement
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 14:55:18 -0400
PARAMETERS [Enter Start Date] DateTime, [Enter End Date] DateTime;
SELECT [Enter Start Date] AS StartDate
, [Enter End Date] AS EndDate
Change
Count(*)([Monthly Reports]![Resolved by or last Assigned]) AS [Total
Episodes Resolved]
To
, Count([Monthly Reports]![Resolved by or last Assigned]) AS [Total Episodes
Resolved]
FROM [Monthly Reports] <<<<<< You need this line
WHERE ((([Monthly Reports].[Opened]) Between [Enter Start Date] And [Enter
End Date]))
GROUP BY [Enter Start Date] <<<<< Include all fields in group by that are
in the select are not using an aggregate function
, [Enter End Date]
, [Monthly Reports]![Resolved by or last Assigned] <<< If you ae counting
this then you don't need it in the group by line
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"Frustrated in AL" <FrustratedinAL@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:A724B7B1-9D87-4D16-A2FF-74A137276B80@xxxxxxxxxxxxxxxx
I seem to be missing something here.
Error Message:
"The SELECT statement includes a reserved word or an argument name that is
misspelled or missing, or the punctuation is incorrect."
The SQL:
PARAMETERS [Enter Start Date] DateTime, [Enter End Date] DateTime;
SELECT [Enter Start Date] AS StartDate, [Enter End Date] AS EndDate,
Count(*)([Monthly Reports]![Resolved by or last Assigned]) AS [Total
Episodes
Resolved]
WHERE ((([Monthly Reports].[Opened]) Between [Enter Start Date] And [Enter
End Date]))
GROUP BY ([Monthly Reports]!Resolved by or last Assigned);
When OK is clicked on the error message, the word WHERE is highlighted.
Name of TABLE: "Monthly Reports"
Date range shown in: "Opened" Field
GROUP BY is users, shown in: "Resolved by or last Assigned" Field.
Purpose of Query: Count the number of episodes, within a specific date
range and sort by user.
Any help would be appreciated.
.
- References:
- Error message on Where statement
- From: Frustrated in AL
- Error message on Where statement
- Prev by Date: Re: Adding ID field with numbers in increments of 100
- Next by Date: Re: How To Avoid Cartesian Products?
- Previous by thread: RE: Error message on Where statement
- Next by thread: MS Access Join Query
- Index(es):
Relevant Pages
|