Hello experts,
Need help figuring out YeartoDate and Last12Months syntax. I'm trying experts, trying my best.
YearToDate = is it
select * from table where convert_to_epoch(arrival_time) between TRUNC(SYSDATE,'YEAR') and sysdate;
Last12Months
select * from table where convert_to_epoch(arrival_time) between last_day(add_months(sysdate, -12)) + 1 and sysdate from dual;
Now if this is correct why do I get the error Date Format Picture Ends before converting entire Input String. My epoch function converts field to format 30-OCT-2000 10:05:47
Need help figuring out YeartoDate and Last12Months syntax. I'm trying experts, trying my best.
YearToDate = is it
select * from table where convert_to_epoch(arrival_time) between TRUNC(SYSDATE,'YEAR') and sysdate;
Last12Months
select * from table where convert_to_epoch(arrival_time) between last_day(add_months(sysdate, -12)) + 1 and sysdate from dual;
Now if this is correct why do I get the error Date Format Picture Ends before converting entire Input String. My epoch function converts field to format 30-OCT-2000 10:05:47