G
Guest
The following query returns the error "Data type mismatch in criteria
expression" and I honestly have NO CLUE why this doesn't work:
SELECT * FROM
(SELECT * FROM qryProjects WHERE qryProjects.ID IN
(SELECT ID FROM tblProjects
WHERE tblProjects.connectionDate IS NOTNULL)
) AS tblNew
WHERE MonthName(DatePart('m',tblNew.ConDate)) = "February";
Basically the qryProjects will format the dates in tblProjects according to
a date format specified in tblProjects. However not all rows in tblProjects
specify a date, so I filter those out with the subquery. I know MonthName is
returning a string (and I even tried casting it to a string with CStr)
because when I do the following, I get a list of months:
SELECT MonthName(DatePart('m',tblNew.ConDate)) FROM
(SELECT * FROM qryProjects WHERE qryProjects.ID IN
(SELECT ID FROM tblProjects
WHERE tblProjects.connectionDate IS NOTNULL)
) AS tblNew;
Can someone PLEASE help me figure this out?
expression" and I honestly have NO CLUE why this doesn't work:
SELECT * FROM
(SELECT * FROM qryProjects WHERE qryProjects.ID IN
(SELECT ID FROM tblProjects
WHERE tblProjects.connectionDate IS NOTNULL)
) AS tblNew
WHERE MonthName(DatePart('m',tblNew.ConDate)) = "February";
Basically the qryProjects will format the dates in tblProjects according to
a date format specified in tblProjects. However not all rows in tblProjects
specify a date, so I filter those out with the subquery. I know MonthName is
returning a string (and I even tried casting it to a string with CStr)
because when I do the following, I get a list of months:
SELECT MonthName(DatePart('m',tblNew.ConDate)) FROM
(SELECT * FROM qryProjects WHERE qryProjects.ID IN
(SELECT ID FROM tblProjects
WHERE tblProjects.connectionDate IS NOTNULL)
) AS tblNew;
Can someone PLEASE help me figure this out?