Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: plsql date comparison

Re: plsql date comparison

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 05 Aug 2002 19:55:35 +0200
Message-ID: <cuetkuc4p7e8a92q9f91u0so08316i048j@4ax.com>


On Mon, 5 Aug 2002 17:21:05 +0100, "Mark" <mark.hamlin_at_artdigital.co.uk> wrote:

>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

You are aware you are comparing log_date and displaying log_str How can we know they have the same valyue and your concerns are justified.

Regards

>

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Mon Aug 05 2002 - 12:55:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US