Countymnca
Technical User
Hello,
I have seen several threads (thread701-1167093) that have me pretty close to fixing my problem, however, something is still not correct.
I need to total the number of training hours per person by the current fiscal year (one query) and for the last 2 fiscal years (2nd query). I used the Where statement from the thread listed above and am getting an error.Below is my code....the working line before just used the Where statement with the normal Between [] And []. I used to use a rolling 12 months and 24 months, but the requirement for this type data is now fiscal year (7/1/yy - Now().
How is this done?
Working Code that gives rolling 12 mths
SELECT [tbl Training].IDNumber, Sum([tbl Training].Hours) AS SumOfHours, [tbl Training].ClassType
FROM [tbl Training]
WHERE ((([tbl Training].ClassDate) Between Date() And Date()-365))
GROUP BY [tbl Training].IDNumber, [tbl Training].ClassType
HAVING ((([tbl Training].ClassType)="S.T.C."))
ORDER BY Sum([tbl Training].Hours);
I have seen several threads (thread701-1167093) that have me pretty close to fixing my problem, however, something is still not correct.
I need to total the number of training hours per person by the current fiscal year (one query) and for the last 2 fiscal years (2nd query). I used the Where statement from the thread listed above and am getting an error.Below is my code....the working line before just used the Where statement with the normal Between [] And []. I used to use a rolling 12 months and 24 months, but the requirement for this type data is now fiscal year (7/1/yy - Now().
How is this done?
Working Code that gives rolling 12 mths
SELECT [tbl Training].IDNumber, Sum([tbl Training].Hours) AS SumOfHours, [tbl Training].ClassType
FROM [tbl Training]
WHERE ((([tbl Training].ClassDate) Between Date() And Date()-365))
GROUP BY [tbl Training].IDNumber, [tbl Training].ClassType
HAVING ((([tbl Training].ClassType)="S.T.C."))
ORDER BY Sum([tbl Training].Hours);