I am trying to determine which StudentIDs are enrolled in the current academic year. qryCurrentAcademicYr compares today's date with the start/end dates of the academic year and returns a text string, ex. 2016-17 .
I have a query (which I "wrote" in the Query Design window) to compare a student's academic year with the current academic year; SQL is as follows:
This query works fine, and column Current contains 1, 0, or -1, where 0 means the two strings match. The trouble is, when I enter 0 as the criterion for Current, I get
Enter Parameter Value
Yr
SQL for that looks like:
Why does the query without the criterion run fine, but with a criterion does not? Query also ran fine, even with criterion, before I replaced "tblClassAssignment.AcademicYr" with Yr, but I need to alias that field name so that I can combine it with some similar information from another query in a union query.
Thanks for your help.
I have a query (which I "wrote" in the Query Design window) to compare a student's academic year with the current academic year; SQL is as follows:
Code:
SELECT tblClassAssignment.StudentID, tblClassAssignment.AcademicYr AS Yr, qryCurrentAcademicYr.AcademicYr, StrComp(([qryCurrentAcademicYr].[AcademicYr]),([Yr])) AS [Current]
FROM tblClassAssignment, qryCurrentAcademicYr;
Enter Parameter Value
Yr
SQL for that looks like:
Code:
SELECT tblClassAssignment.StudentID, tblClassAssignment.AcademicYr AS Yr, qryCurrentAcademicYr.AcademicYr, StrComp(([qryCurrentAcademicYr].[AcademicYr]),([Yr])) AS [Current]
FROM tblClassAssignment, qryCurrentAcademicYr
WHERE (((StrComp(([qryCurrentAcademicYr].[AcademicYr]),([Yr])))=0));
Thanks for your help.