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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.