I am using the following in a where statement for a sub-select: glpastyr.calmonth = DATEPART(month,getdate())-3
this will work fine if the current date is greater than march 31 of any given year. If it is less than 3/31/xxxx then an error is returned because the month becomes a negative number.
Do any of you know of a way around this?
this will work fine if the current date is greater than march 31 of any given year. If it is less than 3/31/xxxx then an error is returned because the month becomes a negative number.
Do any of you know of a way around this?