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
"Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. "
You are 3719 reader
since 1st April 2009
Yes | 0 | |
No | 0 |