Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating Age
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00627078
Message ID:
00630093
Vues:
32
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform