Oracle Time Comparisons

vincent picture vincent · Mar 8, 2012 · Viewed 25.9k times · Source

Is Oracle (10g) doing a proper TIME comparison here, or do I need to convert to decimal time and then compare? E.g.,

IF (SELECT TO_CHAR(sysdate,'HH24:MI:SS') from dual) <= '15:00'
THEN (...)

Thanks.

Answer

cagcowboy picture cagcowboy · Mar 8, 2012
IF (sysdate <= trunc(sysdate)+15/24)
THEN (...)

should do the trick...