Re: to_char() accepting invalid dates? - Mailing list pgsql-sql

From THOMPSON, JARED (ATTBAPCO)
Subject Re: to_char() accepting invalid dates?
Date
Msg-id 377C0288D30BE04BA7B5FD60BDFC0C911A6F7040@crexc52p
Whole thread Raw
In response to to_char() accepting invalid dates?  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-sql

ERROR at line 1:

ORA-01839: date not valid for month specified

 

 

That error is coming on

select to_date('20110231', 'YYYYMMDD') from dual;

 

because there are not 31 days in February 2011, try this:

 

select to_date('20110228', 'YYYYMMDD') from dual;

 

Jared Thompson

Internet Operations Group

Office: 678.406.2895

jt060b@att.com

 

 

This e-mail and any files transmitted with it are AT&T property, are confidential, and are intended solely for the use of the individual or entity to whom this email is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited.

 

pgsql-sql by date:

Previous
From: Johann Spies
Date:
Subject: Help with regexp-query
Next
From: Charlie
Date:
Subject: Re: [SQL] Help with regexp-query