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:
00627192
Vues:
23
>>>Anyone know how to calculate the age from a date of birth in a sql statement.
>>>Date of birth is stored in a datetime field (DOB).
>>>
>>>Example:
>>>
>>>select lastname,firstname,dob,age
>>
>>
select lastname,firstname,dob, Datediff(Month, dob, getdate())/12 as age
>
>
>Sergey;
>
>I thought if I just asked my mother I could get a quick answer! :)
>
>Tom

Yea, it would work if you have a reference to the mother object. :)
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform