there is always something to develop
How to find first and last day of the month
The sample bellow shows how to find the start and end date of the month containing specified date.
declare @cDateTime datetime; set @cDateTime = GetDate() select dateadd( month, datediff( month, 0, @cDateTime ), 0 ) as BeginOfTheMonth; select dateadd(d,-1,dateadd( month, datediff( month, 0, @cDateTime )+1,0 )) as EndOfTheMonth
See also
Comments
"Most people will be about as happy, as they decide to be. "
You are 3920 reader
since 1st April 2009
Yes | 0 | |
No | 100.0% |
2 |