Declare @Date1 datetime Declare @Date2 datetime Select @Date1 = '15Feb1971'Select @Date2 = '08Dec2009'select CASE WHEN dateadd(year, datediff (year, @Date1, @Date2), @Date1) > @Date2 THEN datediff (year, @Date1, @Date2) - 1 ELSE datediff (year, @Date1, @Date2)END as Age
--
happy coding
This comment has been removed by a blog administrator.
ReplyDelete