Viewing 2 posts - 1 through 2 (of 2 total)
You're right :
I think I wrote the good instructions but a wrong SQL.
This might be better :
1) Add 1 month
2) Substract the day number of the previousresult :
DECLARE @mydate datetime='20080331'
SELECT...
May 10, 2011 at 12:58 am
Another way to do this :
1) Add 1 month
2) Substract the day number of the previous result :
DECLARE @mydate datetime='20080224'
SELECT DATEADD(day, -DATEPART(day, @Mydate), DATEADD(MONTH, 1, @mydate))
May 10, 2011 at 12:19 am
Viewing 2 posts - 1 through 2 (of 2 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy