Hi,
I'm trying to set the date of a particular parameter to a value that is roughly the month end of the previous month
I've tried doing syntax such as:
select @m.date = datepart(mm - 1, getdate())
If @m.date <> 2
BEGIN
select @r.date = '30' + @m.date + datepart(yyyy,getdate())
END
ELSE
BEGIN
select @r.date = '28' + @m.date + datepart(yyyy,getdate())
END
Any help would be welcomed
I'm trying to set the date of a particular parameter to a value that is roughly the month end of the previous month
I've tried doing syntax such as:
select @m.date = datepart(mm - 1, getdate())
If @m.date <> 2
BEGIN
select @r.date = '30' + @m.date + datepart(yyyy,getdate())
END
ELSE
BEGIN
select @r.date = '28' + @m.date + datepart(yyyy,getdate())
END
Any help would be welcomed