Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Checking if sysdate between two times

566215Mar 9 2007 — edited Mar 9 2007
Hi,
I have a table pr_blocks with the following fields:
start_time DATE
end_time DATE

I have a procedure getCurrentBlocks which returns the records where the systemdate is between start_time and end_time.
I'm having problems because the inserts on the fields are like this
to_date('10:00',hh24:mi') and the system date is of a different format.
When comparing the dates, I get no records because the month/day/year is checked, while only the time of SYSDATE needs to be checked.

I never use the day/month/year of the fields, so if the solution lays in changing the type of the fields to TIMESTAMP, it's okay. But still, i need a working where-clause, for I don't know how to do this.

Thanks in advance
Joeri
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2007
Added on Mar 9 2007
4 comments
2,688 views