Re: date conversion question

From: DanHW <danhw_at_aol.com>
Date: 29 May 1998 05:47:33 GMT
Message-ID: <1998052905473300.BAA04318_at_ladder01.news.aol.com>


>I have two date fields with the following information (data):
>
>trans_date ==> 19980528 00:00:00
>value_date ==> 28-MAY-98 00:00:00
>
>How can I compare these two date fields?
>
>
>Kevin
>
>

Remember the date is stored in Oracle in DATE format; what you are showing are dates represented as strings. You need to convert them both to a true date. The value date is already in the Oracle default (depending on your system though). To compare them, convert them to a date like this... ...
WHERE
    TO_DATE(trans_date,'YYYYMMDD HH:MI:SS') =     TO_DATE(value_date,'DD-MON-YY HH:MI:SS')

Hope this helps
Dan Received on Fri May 29 1998 - 07:47:33 CEST

Original text of this message