Hi, I have a problem with my query which works fine prior to upsizing to SQL Server. Now I have an Access Front-end with SQL Server (2005) back-end client/server setup. This problem has bugged me for over one full day and I can't find anything that seems to solve it. Any suggestions is appreciated.
The error that comes up is this:
Run-time error '3146':
ODBC--call failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '='. (#102)
The line that's producing the error is a DoCmd.RunSQL "SELECT tblPBC..." The full statement is below. I can't seem to see anything wrong w/ my syntax below....
I have checked and nothing appears to be null. The statement works fine if I remove the GROUP BY (Date()-tblPBC.EnteredDate) <= 29 and HAVING (Date()-tblPBC.EnteredDate) <= 29 = True, but that's not what I want... Datatypes appear to be fine as well.
tblPBC.EnteredDate Datetime
The error that comes up is this:
Run-time error '3146':
ODBC--call failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '='. (#102)
The line that's producing the error is a DoCmd.RunSQL "SELECT tblPBC..." The full statement is below. I can't seem to see anything wrong w/ my syntax below....
Code:
SELECT tblPBC.ProgramSN, tblChild.Community, Count(tblPBC.ChildID) AS CountOfChildID
INTO tmpProgramParticipationSource
FROM tblChild LEFT JOIN tblPBC
ON (tblChild.ChildID = tblPBC.ChildID)
GROUP BY tblPBC.ProgramSN, tblChild.Community, (Date()-tblPBC.EnteredDate) <= 29
HAVING (((Date()-tblPBC.EnteredDate)<=29)=True);
I have checked and nothing appears to be null. The statement works fine if I remove the GROUP BY (Date()-tblPBC.EnteredDate) <= 29 and HAVING (Date()-tblPBC.EnteredDate) <= 29 = True, but that's not what I want... Datatypes appear to be fine as well.
tblPBC.EnteredDate Datetime