Re: date question

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: javier garcia - CEBAS <rn001(at)cebas(dot)csic(dot)es>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: date question
Date: 2003-06-16 17:24:02
Message-ID: 20030616172402.GA2940@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Jun 13, 2003 at 13:44:09 +0200,
javier garcia - CEBAS <rn001(at)cebas(dot)csic(dot)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).

In response to

  • date question at 2003-06-13 11:44:09 from javier garcia - CEBAS

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-06-16 17:28:50 Re: [SQL] "No such attribute or function 'oid'"
Previous Message Nicolas JOUANIN 2003-06-16 16:41:21 Let join syntax