From: Bruno Wolff III <bruno@wolff.to>
To: javier garcia - CEBAS <rn001@cebas.csic.es>
Cc: pgsql-sql@postgresql.org
Subject: Re: date question
Date: Mon, 16 Jun 2003 12:24:02 -0500
Message-ID: <20030616172402.GA2940@wolff.to> (raw)
In-Reply-To: <200306131130.h5DBUiI06008@natura.cebas.csic.es>
References: <200306131130.h5DBUiI06008@natura.cebas.csic.es>
On Fri, Jun 13, 2003 at 13:44:09 +0200,
javier garcia - CEBAS <rn001@cebas.csic.es> wrote:
>
> And I've got another related tables with a date field. I need to compare the
> dates field in the other tables with "year", "month", "day" in this table.
>
> Is there a way to create a table from this table, directly in Postgres in
> which a date field is created based in the values of "year", "month", "day"
> in this table?
Yes. You could concatenate the values for year, month and day and cast the
resulting string to date.
In the long run you might be better storing the dates as dates in the table
and extracting the year, month and day when reporting (or perhaps using
a view to add them as additional columns).
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: bruno@wolff.to, rn001@cebas.csic.es
Subject: Re: date question
In-Reply-To: <20030616172402.GA2940@wolff.to>
* 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