Maysarah
Right there with Babe
Points: 763
More actions
June 20, 2008 at 8:37 am
#188216
Comments posted to this topic are about the item Is_Leap Function
nigel.
SSChampion
Points: 11636
August 12, 2008 at 2:52 am
#856539
Or alternatively this:
select IsLeapYear = case when day(dateadd(day,-1,dateadd(month,2,dateadd(year,@year-1900,0)))) = 29 then 1 else 0 end
Which basically calculates the day before March 1st.
NigelHow to post questions
August 13, 2008 at 1:25 pm
#857682
I Liked it 🙂
jofa
SSC Rookie
Points: 38
August 19, 2008 at 3:09 am
#859856
You could get the same result from something like
isdate(cast(@year as char(4)) + '-02-29')
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply