Technical Article

Finding the first day of the Month

,

This script derives the first day of the month and the last day of the previous month...

declare @Today datetime
select @Today = '20020424'
select FirstDay = dateadd(dd,-1*datepart(dd, @Today)+1, @Today)
select LastDay  = dateadd(dd,-1*datepart(dd, @Today), @Today)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating