My Enddate is 2009-05-31 (using sql server)
@EndDate datetime
select startdate = dateadd(mm,-12,@EndDate)
If my EndDate = 2009-05-31
with code above will my
StartDate = 31-05-2008 is my code correct?
I want my senddate to be in the month of April so
month(senddate) = month(dateadd(day,-1,dateadd(mm,-1,@EndDate))
is my code above correct?
Check below
More simple
example
Start of month