how to fetch a year and day of the year using query in sql server 2008
Ex:
11: YY (Year) 292: Day of the year .31 + 28 +31 + 30 + 31 + 30 +31 + 31 +30
How about
select year(thedatetime) - 2000, 1 + datediff(day, cast(year(thedatetime) as varchar(4)) + '0101', thedatetime)
SELECT RIGHT(YEAR(GETDATE()),2), DATEPART (DAYOFYEAR,GETDATE())