there is always something to develop
How to find a number of days in a year
The easiest way to find the number of days in a year, will be finding its first and last day date and just get the diffrence between them. As bellow:
declare @cDateTime datetime; set @cDateTime = GetDate() select datediff(d, dateadd( year, datediff( year, 0, @cDateTime ), 0 ), dateadd(d,-1,dateadd( year, datediff( year, 0, @cDateTime )+1,0 )) )+1 as DaysInYear
See also
Comments
"The man who has confidence in himself gains the confidence of others."
You are 3739 reader
since 1st April 2009
Yes | 0 | |
No | 0 |