Hello,
Can you please correct the sql to get @ClosedMonthStart
at present I get the error: Explicit conversion from data type int to date is not allowed.
I would like @ClosedMonthStart to show '2021-05-01'
Thank you
DECLARE @PreviousYearOfCurrentDate date = dateadd(year, -1, current_timestamp)
DECLARE @PreviousYear INT = YEAR(@PreviousYearOfCurrentDate)
print @PreviousYear
DECLARE @ClosedMonthStart DATE = cast(@PreviousYear + '-05-01' as date)
--print @ClosedMonthStart