@clcardinal Here are some fields I set up to run a report for company labor hours for comparable periods (we use company Fiscal Months and Years instead of going strictly by the calendar, so feel free to tweak accordingly).
Last Year YTD Labor (returns 2020 Fiscal Months 1-9 if run today)
sum(case when datediff(day , FiscalPer.StartDate,dateadd(month, -13, Constants.Today)) >= 0 and dateadd(month, -13, Constants.Today) >= FiscalYr.StartDate and dateadd(month, -13, Constants.Today) <= FiscalYr.EndDate
then LaborDtl.LaborHrs
else 0
end)
Last Year Last Fiscal Period (returns 2020 FM 9)
sum(case when dateadd(month, -13, Constants.Today) >= FiscalPer.StartDate and dateadd(month, -13, Constants.Today) <= FiscalPer.EndDate
then LaborDtl.LaborHrs
else 0
end)
Current Year YTD (returns 2021 FM 1-9)
sum(case when datediff(day, FiscalPer.StartDate,dateadd(month, -1, Constants.Today)) >= 0 and dateadd(month, -1, Constants.Today) >= FiscalYr.StartDate and dateadd(month, -1, Constants.Today) <= FiscalYr.EndDate
then LaborDtl.LaborHrs
else 0
end)
Current Year Fiscal Period (returns 2021 FM 9)
sum(case when dateadd(month, -1, Constants.Today) >= FiscalPer.StartDate and dateadd(month, -1, Constants.Today) <= FiscalPer.EndDate
then LaborDtl.LaborHrs
else 0
end)
We have this report set to run near the middle of each month so there’s no conflicts with the endpoints of the fiscal periods. Hope this helps.