How to substract a birthdate to get current age

How to substract a birthdate to get current age

Post by Sandra Luca » Fri, 19 Oct 2001 19:46:49



Hi,

Can you help me write a MS SQL 7.0/2000 stored procedure statement to do the
following:

Substract Birthdate of an individual from a current date and get his age as
a result.

"Birthdate" is a column name. It holds nchar value of 11/23/1971

I want to take the nchar value of 11/23/1971 and substract it from the
current date to get a current age of the individual.

Please help me.
Thank you so much,

Sandra

 
 
 

How to substract a birthdate to get current age

Post by Crai » Sat, 20 Oct 2001 00:55:53


select datediff(year, convert(datetime, bithdate), getdate())
from table_name

If you need to be more precise you can do:



from table_name


> Hi,

> Can you help me write a MS SQL 7.0/2000 stored procedure statement to do the
> following:

> Substract Birthdate of an individual from a current date and get his age as
> a result.

> "Birthdate" is a column name. It holds nchar value of 11/23/1971

> I want to take the nchar value of 11/23/1971 and substract it from the
> current date to get a current age of the individual.

> Please help me.
> Thank you so much,

> Sandra


 
 
 

1. How to substract a birthdate to get current age

Hi,

Can you help me write a MS SQL 7.0/2000 stored procedure statement to do the
following:

Substract Birthdate of an individual from a current date and get his age as
a result.

"Birthdate" is a column name. It holds nchar value of 11/23/1971

I want to take the nchar value of 11/23/1971 and substract it from the
current date to get a current age of the individual.

Please help me.
Thank you so much,

Sandra

2. crash with TBatchMove

3. Evaluation Edn Win98 Install Failure

4. using the "for xml" clause

5. Calculate age from birthdate

6. signal/noise ratio terrible

7. Converting birthdate to age.

8. Nearest Age By Birthdate?

9. ACCESS 97 Need to calculate age from birthdates

10. Calculate Age from Birthdate