Toad World® Forums

Gregorian Date & Time

Hello I have a recurring report request and the user is asking for a - yesterday at 7 am to today at 12:30pm. Do you know the gregorian calendar time code for this?

You will need to place the filter statements within the SQL itself. For example, in Oracle:

select * from mytable
where mydate between
(to_date (to_char (trunc (sysdate, ‘DD’) - 1, ‘YYYYMMDD’) || ‘07’, ‘YYYYMMDDHH24’))
and
(to_date (to_char (trunc (sysdate, ‘DD’), ‘YYYYMMDD’) || ‘1230’, ‘YYYYMMDDHH24MI’)) ;

You do not need to worry about any sort of date conversion; The database itself should do the appropriate date comparisons.