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
"If you have made mistakes, even serious ones, there is always another chance for you. What we call failure is not the falling down but the staying down."
You are 3651 reader
since 1st April 2009
Yes | 0 | |
No | 0 |