Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> plsql date comparison
I am having "fun" with date comparison with plsql. I need to test to see if
log_date is earlier or later sess_cut. I think I've learnt that earlier is
different to less!!
if (log_date > sess_cut ) then
devlog (aas||'PASS: (log_str '|| log_str || ') later (sess_cut: '||
sess_cut_str || ' )' );
elsif (log_date < sess_cut ) then
devlog (aas||'FAIL: (log_str '|| log_str || ') earlier (sess_cut: '||
sess_cut_str || ' )' );
end if;
I get unpredictable results from this:
*GOOD*
PASS: (log_str 05-08-02 05:11:08) later (sess_cut: 05-08-02 04:56:08 )
*BAD*
FAIL: (log_str 05-08-02 04:52:47) earlier (sess_cut: 05-08-02 04:49:10 )
If I simply reverse my logic I still get unpredictable results. I'm having trouble converting these dates into the numeric value. I tried << myfloat := mydate; >> which compiled but gave me a runtime conversion error.
Mark Received on Mon Aug 05 2002 - 11:21:05 CDT
![]() |
![]() |