Hello;
I have date coming in as character datatype. I have requirement that
need to check if given date is past date of a given month then set the date as the last day in the month.
I know how to set for the last date of the month by using last_day function. But I want to know how can I check if the give date value falls in the specific month or out and I think I need to check with year value too for leap year on February last day.
SELECT CASE WHEN to_char(trunc (LAST_DAY(SYSDATE))) < '20180841' THEN LAST_DAY(sysdate) else ‘01’ end from dual;
I used above SQL and I am getting this issue
ORA-00932: inconsistent datatypes: expected DATE got CHAR
I know the issue but want to make sure with the team.
Thank you for your Time and advice.