Hi, I am not a progress expert and I need to access progress from a dts package from sql server and get some data from a progress table.
I use this query to obtain all rows where the date is today and the time is two hours ago.

select col1, col2, col3, col4, col5, col6
from pub.journal
where to_char(datecol, 'yyyy-mm-dd hh:mi:ss') >= to_char(sysdate, 'yyyy-mm-dd') + ' ' + to_char(systime -7200000, 'hh:mi:ss')

It works fine, but at midnight it fails because the systime is 00:00:00 or 01:00:00 and the value that the substract returns is not a valid hour.

What do you recommend me to do to fix this problem??
Do you know another way i can do this??

I will appreciate a lot your help.