Jump to content
  • 0
JanineB

Get Exact Age

Question

How can I get the exact age:

Ex: Today's date is Feb 4, 2019. My birthday is Feb 5, 1998. On my Calculated Value, it shows 21 years old already. My question is how can I show it as 20 years old because it is still not Feb 5. 

This is my current Formula:    Datediff(day,[@Date_of_birth],GetUTCDate())/365

 

I wanted it to be based by day. 

 

Appreciate your help!

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

  • 0

Hi @JanineB,

 

You may try this formula as well. 

 

FLOOR(DATEDIFF(YEAR,[@field:Date_of_Birth],GetDate()) - 

(CASE WHEN DATEADD(YEAR,DATEDIFF(YEAR,[@field:Date_of_Birth],GetDate()),

[@field:Date_of_Birth]) > GetDate() 

THEN 1 

ELSE 0 

END ))

 

It worked in almost all scenarios, considering leap year, date as 29 Feb, etc.

Hope this helps.

 

-kristina

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...