Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating Age
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00627078
Message ID:
00630093
Views:
39
And another...

Select DateDiff(day, @dob, GetDate())/365.25 !

>One more into the ring...
>
>SELECT
>CASE
> WHEN DATEADD(year, DATEDIFF (year, @bdate, GETDATE()), @bdate) > GETDATE() THEN DATEDIFF (year, bdate, GETDATE()) - 1
> ELSE DATEDIFF (year, bdate, GETDATE())
>END
>
>BTW, this comes from the SQL Server FAQ.
>
>-Mike
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Reply
Map
View

Click here to load this message in the networking platform