Re: Error message on Where statement

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.



.



Relevant Pages

  • RE: Error message on Where statement
    ... Good Luck ... "The SELECT statement includes a reserved word or an argument name that is ... When OK is clicked on the error message, ... Name of TABLE: "Monthly Reports" ...
    (microsoft.public.access.queries)
  • Error message on Where statement
    ... I seem to be missing something here. ... "The SELECT statement includes a reserved word or an argument name that is ... When OK is clicked on the error message, ... Name of TABLE: "Monthly Reports" ...
    (microsoft.public.access.queries)
  • RE: Error message on Where statement
    ... Okay, I've got the query running, but instead of giving me the user names ... "The SELECT statement includes a reserved word or an argument name that is ... When OK is clicked on the error message, ... Name of TABLE: "Monthly Reports" ...
    (microsoft.public.access.queries)
  • Re: Using a form to set criteria for a query
    ... When I get that error message, it means my query has more than one ... Caution! ... Access treats the word "name" as a reserved word. ...
    (microsoft.public.access.formscoding)
  • Re: Date error
    ... Is there an error message? ... Also you should IMMEDIATELY change your field name from Date (which is a ... reserved word) to anything else (Rumplestiltskin would be better, ... kind of date like StartDate or DueDate would get you out reserved word hell ...
    (microsoft.public.access.formscoding)