SELECT CASE
WHEN TO_DATE (:psdate) <
TO_DATE ('01-APR-' || SUBSTR (:psdate, 8, 4))
THEN '01-APR-'
|| TO_CHAR (TO_NUMBER (SUBSTR (:psdate, 8, 4)) - 1)
ELSE '01-APR-' || SUBSTR (:psdate, 8, 4)
END CURRENT_YTD
FROM DUAL;
WHEN TO_DATE (:psdate) <
TO_DATE ('01-APR-' || SUBSTR (:psdate, 8, 4))
THEN '01-APR-'
|| TO_CHAR (TO_NUMBER (SUBSTR (:psdate, 8, 4)) - 1)
ELSE '01-APR-' || SUBSTR (:psdate, 8, 4)
END CURRENT_YTD
FROM DUAL;