Re: date question - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: date question
Date
Msg-id 20030616172402.GA2940@wolff.to
Whole thread Raw
In response to date question  (javier garcia - CEBAS <rn001@cebas.csic.es>)
List pgsql-sql
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).


pgsql-sql by date:

Previous
From: "Julian Scarfe"
Date:
Subject: Re: Ordering in an aggregate -- points to paths
Next
From: Tomasz Myrta
Date:
Subject: Re: "No such attribute or function 'oid'"