Re: Incrementar campo de tipo date.

From: Lennin Caro <lennin(dot)caro(at)yahoo(dot)com>
To: PostgreSQL <pgsql-es-ayuda(at)postgresql(dot)org>, Carlos Agustín López Avila <cagustinla(at)gmail(dot)com>
Subject: Re: Incrementar campo de tipo date.
Date: 2009-11-19 02:45:40
Message-ID: 15049.29787.qm@web59511.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


--- On Thu, 11/19/09, Carlos Agustín López Avila <cagustinla(at)gmail(dot)com> wrote:

From: Carlos Agustín López Avila <cagustinla(at)gmail(dot)com>
Subject: [pgsql-es-ayuda] Incrementar campo de tipo date.
To: "PostgreSQL" <pgsql-es-ayuda(at)postgresql(dot)org>
Date: Thursday, November 19, 2009, 2:23 AM

Buena noches a todos.
Necesito incrementar un campo de tipo date con cantidades numericas que representan años, meses y dias. ejemplo
select fecha + 10 años + 2 meses + 4 dias from tabla;

Gracias.

-----Inline Attachment Follows-----

--
TIP 5: ¿Has leído nuestro extenso FAQ?
         http://www.postgresql.org/docs/faqs.FAQ.html

con esto puedes incrementar un mes

select current_date + interval '1 months'

mas referncias

http://www.postgresql.org/docs/8.3/interactive/functions-datetime.html

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Lennin Caro 2009-11-19 02:51:51 Re: diferencia de fecha con postgresql y perl
Previous Message Carlos Agustín López Avila 2009-11-19 02:23:04 Incrementar campo de tipo date.