Hello,
I am trying to sum WagesSubjToWitholding for the previous quarter.
So, run the previous quarter every quarter of the calendar year.
Here's a snippet
Code:
Sum(IIf([CalendarMonth] In ("01","02","03"),[WagesSubjToWithholding],0)) AS Q1, Sum(IIf([CalendarMonth] In ("04","05","06"),[WagesSubjToWithholding],0)) AS Q2, Sum(IIf([CalendarMonth] In ("07","08","09"),[WagesSubjToWithholding],0)) AS Q3, Sum(IIf([CalendarMonth] In ("10","11","12"),[WagesSubjToWithholding],0)) AS Q4, (Val([CalendarMonth])+2)\3 AS Quarter
WHERE (((PR_EmployeeTaxHistory.CalendarYear)=Year(Date())))
I am not sure how to use
Code:
(Val([CalendarMonth])+2)\3
due to the only fields in the table are CalendarYear and CalendarMonth, no actual Date field.
What is the syntax to Sum the previous quarter only and not separately with Q1, Q2, Q3, Q4?
And the 4th quarter needs to report at the beginning of next year.
So the 4th quarters; CalendarMonth IN ("10","11",12") would show AS PrevQtr in the first quarter in 2020
Hopefully I made sense?