From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: Create Datefield from 3 fields
Date: Wed, 06 Oct 2010 13:36:16 +0200
Message-ID: <i8hmvg$mqd$1@dough.gmane.org> (raw)
In-Reply-To: <AANLkTimswkQCUiZMT4EGkE-w5XKv5mgd3RcfdnT-N8QF@mail.gmail.com>
References: <AANLkTimswkQCUiZMT4EGkE-w5XKv5mgd3RcfdnT-N8QF@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: Create Datefield from 3 fields
In-Reply-To: <i8hmvg$mqd$1@dough.gmane.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox