Vijay Anand
Vijay Anand

Reputation: 11

How to compare date format in where clause

I would like to extract data where all the records were created after 19:00:00 yesterday until now. What I have so far is :

Select * from table where lstupdt >=trunc(sysdate -1);

How to specify after 19:00:00 hours?

Upvotes: 0

Views: 102

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1271241

Hmmm . . . How about this?

where lstupdt >= trunc(sysdate - 1) + 19 / 24

Or, alternatively, to be more accurate:

where lstupdt >= trunc(sysdate - 1, 'day') + interval '19' hour

or:

where lstupdt >= trunc(sysdate, 'day') - interval '5' hour

Upvotes: 3

Related Questions