Re: Microsoft Access Expression Problem
- From: John Spencer <spencer@xxxxxxxxxx>
- Date: Thu, 22 Mar 2007 19:45:03 -0400
Since you have two tables with a field named Date then you need to qualify the reference to the Date field by adding the table name
Year(DateAdd("m",3,T1.[Date]))
'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
j.boswell@xxxxxxxxxxx wrote:
When I try the following:.
SELECT T1.SITE_NO, T1.DATE, T1.FLOW, Avg(T2.FLOW) AS
Avg7Day,Year(DateAdd("m",3,[DATE])) AS FY
FROM [USGS RAW] AS T1 INNER JOIN [USGS RAW] AS T2 ON T1.SITE_NO =
T2.SITE_NO
WHERE (((T1.SITE_NO)="03345000") AND ((T1.DATE)>=([T2].[DATE]-3) And
(T1.DATE)<=([T2].[DATE]+3)))
GROUP BY T1.SITE_NO, T1.DATE, T1.FLOW, Year(DateAdd("m",3,[DATE])) AS
FY;
I receive this error: "Syntax error (missing operator) in query
expression 'Year(DateAdd("m",3,[DATE])) AS FY'.
I think this is referring to my GROUP BY statement. So I removed the
'Year(DateAdd("m",3,[DATE])) AS FY' in the GROUP BY statement. I've
tried replacing it with a few things but keep receiving this error
"The specified field '[DATE]' could refer to more than one table
listed in the FROM clause of your SQL statement."
- Follow-Ups:
- Re: Microsoft Access Expression Problem
- From: j . boswell
- Re: Microsoft Access Expression Problem
- From: j . boswell
- Re: Microsoft Access Expression Problem
- References:
- Microsoft Access Expression Problem
- From: j . boswell
- Re: Microsoft Access Expression Problem
- From: John Spencer
- Re: Microsoft Access Expression Problem
- From: Gary Walter
- Re: Microsoft Access Expression Problem
- From: Gary Walter
- Re: Microsoft Access Expression Problem
- From: Gary Walter
- Re: Microsoft Access Expression Problem
- From: j . boswell
- Re: Microsoft Access Expression Problem
- From: John Spencer
- Re: Microsoft Access Expression Problem
- From: j . boswell
- Re: Microsoft Access Expression Problem
- From: j . boswell
- Re: Microsoft Access Expression Problem
- From: John Spencer
- Re: Microsoft Access Expression Problem
- From: j . boswell
- Re: Microsoft Access Expression Problem
- From: j . boswell
- Microsoft Access Expression Problem
- Prev by Date: Create table in blank databse
- Next by Date: Re: A query that shows "deletable" records
- Previous by thread: Re: Microsoft Access Expression Problem
- Next by thread: Re: Microsoft Access Expression Problem
- Index(es):
Relevant Pages
|