Sunday, March 25, 2012

Day of year

How would I get the day of year from a datetime field in a query?
Such as Feb. 28 would be day 59.
Thank youSELECT DATEPART(DAYOFYEAR,'20050228') ;
David Portas
SQL Server MVP
--
"Lyners" <Lyners@.discussions.microsoft.com> wrote in message
news:78DFFDDD-9227-4A95-896E-F50FDCBB4E17@.microsoft.com...
> How would I get the day of year from a datetime field in a query?
> Such as Feb. 28 would be day 59.
> Thank you

No comments:

Post a Comment