AIRWALKER-375999 (10/24/2016)
Thom A (10/24/2016)
If you are using your above logic, ensure you change your Current DOB logic as well. Otherwise, you'll notice that some other current ages will be wrong (such as 01-Nov-1987, which would show 29, not 28).Thanks for mentioning that, my final code is:
select dob,
floor(datediff(d,dob,getdate()) /365.25) as [current_age],
floor(datediff(d,dob,dateadd(month,6,getdate())) /365.25) as [AGE_IN_SIX_MONTHS]
from person
These formulas aren't completely reliable.