Search Postgresql Archives

Re: issue with an assembled date field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Bowlby <excalibur@xxxxxxxxxxxxx> writes:
>  I am converting an encoded field (lot_id) into a date field, the 5
> character of every lot_id is always the year and as such I need to
> extract the year using the following function:
>  substring(ilch.lot_id::text, 5, 1)

Well, I'd say that the failure proves that some of your data does
*not* have the year in the fifth character.

> ERROR:  invalid input syntax for type date: "01/01/0W"

Time for some data sanitizing?

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux