With the help of IanH I was able to throw together this SQL:
SELECT Month(ReviewDay)&Year(ReviewDay) AS MyMonth, Count(*) AS MyCount, Sum(IIf(SignedOn-SchTime<3 And SignedOff=0,1,0))+Sum(IIf(SchTime-SignedOff<3 And SignedOn=0,1,0)) AS HoursMet FROM Adherence GROUP BY Month(ReviewDay)&Year(ReviewDay) ORDER BY Month(ReviewDay)&Year(ReviewDay) DESC"
As you can see, I am grouping my records by a combination of month and year. Now the problem, I want it to be ordered by the most recent month/year to the oldest. The above lists months 2-9 before months 10-12. I realize it is because the SQL doesn't recognize Month(ReviewDay)&Year(ReviewDay) as a date. Any thoughts on how to tackle this part of the equation?
SELECT Month(ReviewDay)&Year(ReviewDay) AS MyMonth, Count(*) AS MyCount, Sum(IIf(SignedOn-SchTime<3 And SignedOff=0,1,0))+Sum(IIf(SchTime-SignedOff<3 And SignedOn=0,1,0)) AS HoursMet FROM Adherence GROUP BY Month(ReviewDay)&Year(ReviewDay) ORDER BY Month(ReviewDay)&Year(ReviewDay) DESC"
As you can see, I am grouping my records by a combination of month and year. Now the problem, I want it to be ordered by the most recent month/year to the oldest. The above lists months 2-9 before months 10-12. I realize it is because the SQL doesn't recognize Month(ReviewDay)&Year(ReviewDay) as a date. Any thoughts on how to tackle this part of the equation?