This comment is for readers who have found this entry but are using mysql instead of oracle! on mysql you can do the following: Today
SELECT *
FROM
WHERE date(tran_date) = CURRENT_DATE()
Yesterday
SELECT *
FROM yourtable
WHERE date(tran_date) = DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
trunc(tran_date) = trunc(sysdate -1)
If you don't support future dated transactions then something like this might work:
AND oh.tran_date >= trunc(sysdate-1)
If you want the timestamp for yesterday try something like:
(CURRENT_TIMESTAMP - INTERVAL '1' DAY)
to_char(tran_date, 'yyyy-mm-dd') = to_char(sysdate-1, 'yyyy-mm-dd')
Source: Stackoverflow.com