Question: Is there a way to calculate how old someone is based on today's date and their birthday then display it in following manners:

```
If a user is less than (<) 1 year old THEN show their age in MM & days.
Example:  10 months & 2 days old 

If a user is more than 1 year old AND less than 6 years old THEN show their age in YY & MM & days.
Example:  5 years & 3 months & 10 days old

If a user is more than 6 years old THEN display their age in YY.
Example:  12 years

```

Answer: 
from this previous question 
[How to calculate age in T-SQL with years, months, and days](https://stackoverflow.com/questions/57599/how-to-calculate-age-in-t-sql-with-years-months-and-days)

you can do procedure like this

```
       CREATE procedure [dbo].[proc_datediff]
       (
        @date datetime
        )
       as
      begin 
  DECLARE @diff varchar(70)
  DECLARE  @tmpdate datetime, @years int, @months int, @days int

 SELECT @tmpdate = @date

    SELECT @years = DATEDIFF(yy, @tmpdate, GETDATE()) - CASE WHEN  
    (MONTH(@date) > MONTH(GETDATE())) OR (MONTH(@date) = 
   MONTH(GETDATE()) AND DAY(@date) > DAY(GETDATE())) THEN 1 ELSE 0 END
   SELECT @tmpdate = DATEADD(yy, @years, @tmpdate)
  SELECT @months = DATEDIFF(m, @tmpdate, GETDATE()) - CASE WHEN 
 DAY(@date) > DAY(GETDATE()) THEN 1 ELSE 0 END
   SELECT @tmpdate = DATEADD(m, @months, @tmpdate)
 SELECT @days = DATEDIFF(d, @tmpdate, GETDATE())
  select @diff=
  case
     when @years < 1 then
   concat( @months,'  Months ',@days,'  days ' )
   when @years >=1 and @years < 6
    then 
    concat(@years,'  year ', @months,'  Months ',@days,'  days ' )
 when @years >= 6  then

  concat( @years,'  years ' )
   end;
 select @diff

 end
 execute proc_datediff '1/1/2016'
  go

```
`dc.DayMarker = cast(getdate() as date)`

> 
> DAYmarker is your date field.
> 
> 
>