Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01843 question
On Tue, 29 Mar 2005 17:05:31 GMT, yuhong snyder
<yuhong1999_at_hotmail.com> wrote:
>when using a simple sql:SELECT LAST_DAY('01-Feb-95') FROM DUAL,the
>result always remind ORA-01843 error,invalid month,I think the format of
>month is correct.
>
>any hint?
>
>thanks!
Never rely on the default date format of your client (which obviously isn't DD-MON-YY, because otherwise you wouldn't have gotten this error message) but always explicitly use the to_day function to eliminate ambiguity.
select last_day(to_date('01-FEB-95','DD-MON-RR')) from dual
is the correct select.
-- Sybrand Bakker, Senior Oracle DBAReceived on Tue Mar 29 2005 - 11:24:28 CST