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

Share

Share

Rate