cloudtwter
Technical User
SELECT
COL1,
CASE COL1
when (days(date(SUBSTR(COL1, 1, 4) || '-' || SUBSTR(COL1, 5, 2)|| '-' || SUBSTR(COL1, 7, 2)))
>
(days(current_date)-365))
THEN 'A'
ELSE 'B'
FROM TAB1;
COL1 is chat(8) storing as date for yyyymmdd
Trying to get less/greater than than 1 year old with case as A/B
COL1,
CASE COL1
when (days(date(SUBSTR(COL1, 1, 4) || '-' || SUBSTR(COL1, 5, 2)|| '-' || SUBSTR(COL1, 7, 2)))
>
(days(current_date)-365))
THEN 'A'
ELSE 'B'
FROM TAB1;
COL1 is chat(8) storing as date for yyyymmdd
Trying to get less/greater than than 1 year old with case as A/B