Re: Create Datefield from 3 fields

Поиск
Список
Период
Сортировка
От Andreas Forø Tollefsen
Тема Re: Create Datefield from 3 fields
Дата
Msg-id AANLkTimUu=E7G4yd3r6F0T-Nq3065KWKoXV31-6+T=uq@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Create Datefield from 3 fields  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-sql
Excellent. I did not see that.

Thank you

2010/10/6 Thomas Kellerer <spam_eater@gmx.net>
Andreas Forø Tollefsen, 06.10.2010 13:11:

Hi.

I am trying to create a datefield using YEAR, MONTH and DAY fields of type integer.
I tried this query, but it did not give good results:
select to_date(gwsyear::text || gwsmonth::text || gwsday::text, 'YYYY-MM-DD') FROM cshapes

You are missing the dashes in the input string that you specify in the format mask


 to_date(gwsyear::text ||'-'|| gwsmonth::text ||'-'|| gwsday::text, 'YYYY-MM-DD')


Thomas


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

В списке pgsql-sql по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Create Datefield from 3 fields
Следующее
От: Gary Chambers
Дата:
Сообщение: Duplicates Processing