Reputation: 95
I want to find a time today and yesterday in sql query. My example is in error and does not find all the rows. Database is sql oracle. I would be grateful for any help. example:
and (to_char(zsd.SB_ACTUAL+600/1440, 'dd.mm.yyyy') > to_char(current_date-1, 'dd.mm.yyyy')
Upvotes: 2
Views: 75
Reputation: 40481
Why are you converting the dates into strings?
and zsd.SB_ACTUAL/* If necessary, add your calculation here */ > sysdate-1
Or use TRUNC()
if you want to ignore the time attribute :
and TRUNC(zsd.SB_ACTUAL) /* If necessary, add your calculation here */ > TRUNC(sysdate-1)
Upvotes: 2