Můžete zkusit:
declare @y int;
set @y = 2014;
SELECT DATEDIFF(day, cast(@y as char(4)), cast(@y+1 as char(4))) Days
Výsledek:
Days
365
2Verze podle komentáře:
declare @y int;
set @y = 2014;
SELECT DATEDIFF(day, cast(cast(@y as char(4)) as date), cast(cast(@y+1 as char(4)) as date)) DaysCnt