LeighDreyer
Programmer
Tryint to check if a persons age is over 65 if so place a Y in table else place a N in table this is my attempts with no luck it is perfomed inside a SELECT statement and not an update. line with satrs is where I need to perform DECODE
SELECT
A.NAME AS "WARD NAME",
F.TODAYS_DATE AS "DATE",
DECODE(C.SEXXX_REFNO,'250564','M','250416', 'F') AS "SEX",
***ROUND((F.TODAYS_DATE - C.DATE_OF_BIRTH) / 365) AS "AGE"
Method 1
DECODE(ROUND((F.TODAYS_DATE - C.DATE_OF_BIRTH) / 365) > 65 ,Y,N) AS "AGE"
Method 2
Decode(Sign(65-ROUND((F.TODAYS_DATE - C.DATE_OF_BIRTH) / 365)), 1, N, Y )
anyone know how to do this ?
SELECT
A.NAME AS "WARD NAME",
F.TODAYS_DATE AS "DATE",
DECODE(C.SEXXX_REFNO,'250564','M','250416', 'F') AS "SEX",
***ROUND((F.TODAYS_DATE - C.DATE_OF_BIRTH) / 365) AS "AGE"
Method 1
DECODE(ROUND((F.TODAYS_DATE - C.DATE_OF_BIRTH) / 365) > 65 ,Y,N) AS "AGE"
Method 2
Decode(Sign(65-ROUND((F.TODAYS_DATE - C.DATE_OF_BIRTH) / 365)), 1, N, Y )
anyone know how to do this ?