Timestamp compare in where clause failing
Need to get snap_id from dba_snapshot_hist table for particular time. Select statement is failing with error.
select snap_id,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME from dba_hist_snapshot
where TO_DATE(TO_CHAR(BEGIN_INTERVAL_TIME,'YYYY-MON-DD HH24:MI'),'YYYY-MON-DD HH24:MI')=TO_DATE(TO_CHAR('&begin_time','YYYY-MON-DD HH24:MI'), 'YYYY-MON-DD HH24:MI')
statement failing with Invalid Number while entering date value 17-SEP-2019 0800
Any one please suggest how can I get snap_id of particular time using runtime input (&)
Thanks