there is always something to develop
How to find a number of days in a month
To find the number of days in a month, the easiest way will be finding its last day date and just get the DAY part. As bellow:
declare @cDateTime datetime; set @cDateTime = '2009-02-04' select day(dateadd(d,-1,dateadd( month, datediff( month, 0, @cDateTime )+1,0 ))) as DaysInMonth
See also
Comments
"A person who asks a question might be a fool for five minutes, but a person who doesn't ask, is a fool forever. "
You are 3286 reader
since 1st April 2009
Yes | 0 | |
No | 0 |