Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating Age
Message
From
06/03/2002 16:53:27
 
 
To
06/03/2002 16:45:53
Eugenijus Rimkus
SPAB Siauliu energija
Siauliai, Lithuania
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00627078
Message ID:
00629271
Views:
47
This message has been marked as the solution to the initial question of the thread.
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
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform