select picking up the items that are in the current day and time

0

I want to pick up the items that are smaller than the current date and time, but when I run select it gives the error message, not a valid month. In the database the date is set as follows, '25 / 09/18 10:23 '.

SELECT * FROM v_tpl_acompanhamento WHERE 
coleta_plan = TO_DATE('25/09/18 12:19', 'DD/MM/YY HH24:MM')
    
asked by anonymous 25.09.2018 / 17:24

1 answer

0

The problem is in the date format , the correct one would be 'DD / MM / YY HH24: MI', you are passing MM twice, so he is waiting twice a month.

Also remember, if you need to compare with the current date, just use Sysdate

    
25.09.2018 / 19:12