Re: Help with date comparison
From: Chuck Hamilton <chuckh_at_ix.netcom.com>
Date: 1995/07/18
Message-ID: <3ugqpv$ej3_at_ixnews3.ix.netcom.com>#1/1
Date: 1995/07/18
Message-ID: <3ugqpv$ej3_at_ixnews3.ix.netcom.com>#1/1
In <3ufd8n$95i_at_newsbf02.news.aol.com> rs176_at_aol.com (Rs176) writes:
>select * from mytable
>where to_date(mydate, 'DD-MON') >= to_date('08-Dec', 'DD-Mon')
>and to_date(mydate, 'DD-MON') <= to_date('10-Dec', 'DD-Mon');
>
>
>However, this results in the following error:
>
> ORA-01839: date not valid for month specified
>
>I've tried many other approaches (I won't fill up the newsgroup by
listing
>them), with no success. Can anyone recommend a solution?
>
Try appending a year to my_date. Something like this should work.
SELECT * FROM mytable
WHERE TO_DATE(mydate||'-95) BETWEEN '08-dec-95' AND '10-dec-95';
--Received on Tue Jul 18 1995 - 00:00:00 CEST
><> Chuck Hamilton <><
><> chuckh_at_ix.netcom.com <><