HOW TO FIND OUT AGE OF PERSON IN SQL SERVER?

Pravesh Singh

Total Post:412

Points:2888
Posted by  Pravesh Singh
 2150  View(s)
Ratings:
Rate this:
Hello Guys,.
I've suffering with a problem since last night, actually I've a date of birth(DOB) of any person and I want to find out the current age of that person but I don't have any idea about it. Can you tell how do this?

Please resolve my problem.
  1. Carl Pieterson

    Post:14

    Points:98
    Re: How to find out age of person in sql server?

    you can use datediff() function to find out age of person in sql server.

  1. Pravesh Singh

    Post:412

    Points:2888
    Re: How to find out age of person in sql server?

    Post is removed by the Admin.

  1. Vijay Shukla

    Post:100

    Points:700
    Re: How to find out age of person in sql server?

    Hi, Mr. Pravesh Singh
    you can use simple query for solving your problem.

    SELECT DATEDIFF(year,'1989-12-05',getdate()) 'Age'

    Here DateDiff() is a Sql aggregate Function that will return difference between two dates, and getdate() method will return current system DateTime.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!