Calculating Age from "Date of Birth" Column

Hi,

I have a date of birth(dob) column in my dataset in the format ‘YYYY-MM-DD’. I am trying to calculate the age of today from the dob column. I have birth_date, which function will let me subtract that from today’s date?
I tried DateDiff using NOW() but that didn’t work.

Thank you

Hi @Paramita_Maji
why didn’t worked the datediff?
BR

@Paramita_Maji - Will you be able to share a sample of your dataset? As @erik suggested dateDiff should be the way. Sharing the function documentation below for reference.

Just one additional suggestion since your now() provides timestamp, can you please re-try the dateDiff using your “dob” column alongside truncDate(‘DD’, now()). Hope this helps!

Did my suggestion help you in resolving your query? If yes, would request you to mark the post as “Solution”. This will help the community to find guidance and answers to similar question. Thank you!

This worked for me. Thank you

1 Like