Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: issue with an assembled date field



Chris Bowlby <excalibur(at)accesswave(dot)ca> 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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group