Friday, September 18, 2020

Calculating ages in years

Calculating ages in years isn't as easy as

( current date - birth date ) / 365

@connor_mc_d has a solution - convert the dates to numbers:

trunc ((
 to_number (to_char ( sysdate, 'YYYYMMDD' )) - 
 to_number (to_char ( birth, 'YYYYMMDD' ))
 ) / 10000
)

https://t.co/gVoEijf874 https://t.co/6iSyzBXdUh

Great thanks Connor Sir

No comments:

Post a Comment

Followers