P2K_SMAGE#

Functionality#

This database function will return an Age (in years) given a birth date, and the date that you want to compare against (typically SYSDATE)

Parameters#

BIRTH_DATE The date that is the birth date
AS_OF_DATE The date that you want to find the age “As Of”
NEAREST (Optional) if set to any value (use '1') will round to the nearest year.

Returns:#

Number

Errors:#

If Birth Date is after As_Of Date, then -1 is returned

Examples:#

P2K_SMAGE(~,SYSDATE) will return the age (of the date as the passed parameter) as of today.


Notes #

Click to create a new notes page