Age Calculation

This ought to be easy, and perhaps it is, but it's stumped me. I'm trying to calculate the current AGE of a person. I have a DOB (date of birth) field. I've tried this

DATEDIFF( [DOB], NOW(),'years')

But I get this cryptic error:

'DOB' is not defined for expression 'DATEDIFF( DOB, NOW(),'years')'

I've tried other approaches. In the end, this is the best I've come up with:

ROUND( DATEDIFF( [DOB], NOW(), "years"), 1 )

That'll do the trick for now. But it means I get ages in decimal values. If person was born 2 years and 2 months ago, age is given as 2.1. I'd prefer to simply have "2", but I can't figure out how. There is no INT() or INTEGER() function — there's something we really need. ROUND() won't work. If somebody was born 17 years and 11 months ago, rounding to 0 decimal points will return their age as 18. Similar, but not the same!

I'm praying that a number of additional functions are coming soon.

1
3 replies