I am working on a beast mode calculation and need to mandate that the day of the year last year, based on my `Invoice Date' column, is less than or equals the day of the year this year. I can't think what I need to do to replace the "Last Year" and "This Year" with a working statement
I can't use the Current date function or I certainly would.
Any help would be appreciated!
(SUM(CASE WHEN YEAR(`Invoice Date`) = YEAR(DATE_SUB(CURDATE(),INTERVAL 1 YEAR))
AND DAYOFYEAR(`Invoice Date`) "Last Year" <= DAYOFYEAR(`Invoice Date`) "This Year"
THEN `Total Invoiced $ Amount` ELSE 0
END))