Re: [Pgsql-ayuda] +/- date

From: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
To: "sandrigo lezcano" <psql(at)msa(dot)com(dot)py>
Cc: <Pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx>
Subject: Re: [Pgsql-ayuda] +/- date
Date: 2003-06-11 22:29:06
Message-ID: m3adco1c5p.fsf@conexa.fciencias.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

"sandrigo lezcano" <psql(at)msa(dot)com(dot)py> writes:

> en Sybase hago esto:
>
> set @fecha=dateadd(month,-5,@fecha);
>
> q quiere decir
> "restarle 5 meses a la variable fecha"
> y atribuirle ese valor a la misma variable
>
> ejemplo: ------
>
> The following statement returns the value: 1995-11-02 00:00:00.000.
> SELECT dateadd( month, 102, '1987/05/02' )
> como puedo hacerlo en PostgreSQL ??????

Puedes restarle a la fecha un intervalo, ej

select now() - interval '5 months';

Saludos,
Manuel.

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Manuel Sugawara 2003-06-11 22:38:07 Re: [Pgsql-ayuda] Funcion de agreagdo first
Previous Message Jose Ayala - INCALPACA TPX 2003-06-11 22:09:29 Re: [Pgsql-ayuda] Funcion de agreagdo first