Query Conflict
- From: Stan <stanhanna@xxxxxxxxxxx>
- Date: Fri, 28 Sep 2007 18:20:05 -0700
I am using MS Office Access 2003 (11.5614). I have been running the
following query with good results. The query lets me enter the month
period and returns the SUM of the age fields.
SELECT [Enter Month/Year as mm/yyyy] AS [Month/Year], SUM([0 to 18])
AS [Sum of 0 to 18], SUM([19 to 40]) AS [Sum of 19 to 40], SUM([41 to
65]) AS [Sum of 41 to 65], SUM([66 Plus]) AS [Sum of 66 Plus]
FROM [Lake Worth CFP Clients]
WHERE FORMAT([SvcDate 1],"mm/yyyy")=[Enter Month/Year as mm/yyyy];
I now want to add an additional criteria of the city field. I added
the criteria with the SQL results
..
SELECT [Enter Month/Year as mm/yyyy] AS [Month/Year], Sum([0 to 18])
AS [Sum of 0 to 18], Sum([19 to 40]) AS [Sum of 19 to 40], Sum([41 to
65]) AS [Sum of 41 to 65], Sum([66 Plus]) AS [Sum of 66 Plus]
FROM [Lake Worth CFP Clients]
WHERE (((Format([SvcDate 1],"mm/yyyy"))=[Enter Month/Year as mm/yyyy])
AND (([Lake Worth CFP Clients].City)="Lake Worth"));
I get the following error message:
You tried to execute a query that does not include the specified
expression "city" as part of an aggregate function.
The conflict appears to be between the city criteria and the SUM of
the ages.
Can anyone give me some direction in this matter ?
.
- Follow-Ups:
- Re: Query Conflict
- From: Bob Quintal
- Re: Query Conflict
- Prev by Date: Re: Stripping VAT out and then adding it back - figures do not match
- Next by Date: Re: Manipulating dates
- Previous by thread: Find and Replace Dialog Options
- Next by thread: Re: Query Conflict
- Index(es):
Relevant Pages
|