I am attempting to write a query which will be run daily to capture data from the previous day. What I have so far is:
SELECT a.name, a.username, a.application_number, a.position_cd,
a.start_dt_tm,
a.end_dt_tm,
a.person_id
from application_context a
where
a.START_DT_TM > any (select sysdate -2 from dual)
and a.start_dt_tm < (select sysdate -1 from dual)
This does not work because it uses the current time when it runs. How can I say "yesterday's date from 0000 to 2400"?
SELECT a.name, a.username, a.application_number, a.position_cd,
a.start_dt_tm,
a.end_dt_tm,
a.person_id
from application_context a
where
a.START_DT_TM > any (select sysdate -2 from dual)
and a.start_dt_tm < (select sysdate -1 from dual)
This does not work because it uses the current time when it runs. How can I say "yesterday's date from 0000 to 2400"?