sql age function

Calculating accurate age using SQL is a common and important task and here we will provide you example of SQL and T-SQL Function of how to do it.

If you are after accurate way to calculate Age using T-SQL then the below post might help you.

Below are questions that I try to answer in this post:

  • How to get age from birth date using getdate() (current date) in Tsql
  • How to calculate age from date of birth (DOB) and specified date
  • How to create T-SQL aging UDF function to calculate age from DOB and today's date or specified date
  • Calculate person's age (Accurate age calculation)

    T-SQL Age - years difference

    The above example show difference in years so it is not accurate. If you need accuracy than please use the code below.