Re: Create Datefield from 3 fields

From: Andreas Forø Tollefsen <andreasft(at)gmail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create Datefield from 3 fields
Date: 2010-10-06 11:43:32
Message-ID: AANLkTimUu=E7G4yd3r6F0T-Nq3065KWKoXV31-6+T=uq@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Excellent. I did not see that.

Thank you

2010/10/6 Thomas Kellerer <spam_eater(at)gmx(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Chambers 2010-10-08 15:12:10 Duplicates Processing
Previous Message Thomas Kellerer 2010-10-06 11:36:16 Re: Create Datefield from 3 fields