Re: Date Problem

From: Jean-Michel Chabanne <jeanmichel(dot)chabanne(at)free(dot)fr>
To: Ramesh PAtel <ramesh(at)banas(dot)guj(dot)nic(dot)in>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Date Problem
Date: 2003-05-01 08:00:58
Message-ID: 3EB0D43A.8070407@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ramesh PAtel wrote:

>Hi All
>
>now Problem is
>
>I have to date From = '2003-04-01' and To='2003-05-12'
>now i want to use use date butween From and To.
>and each date one bye one use in query. so how to
>
>i increse date one bye one
>
>Please Help me.
>
>Ramesh Patel
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>
>
>
You may do this :

SELECT DATE (DATE '2003-04-01' + INTERVAL '24:00:00');

or build a PL/PGSQL function as this :

CREATE FUNCTION onedaymore(DATE) RETURNS DATE AS '
DECLARE
olddate ALIAS FOR $1;
newdate date;
BEGIN
newdate := olddate + INTERVAL ''24:00:00'';
RETURN
newdate;
END;
' LANGUAGE 'plpgsql';

--
Jean-Michel Chabanne
77450 MONTRY (FRANCE)
48" 54' N - 2" 49' E
Powered by Linux

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ramesh PAtel 2003-05-01 11:28:31 Problem in FOR loop
Previous Message Hargobind Singh 2003-05-01 07:31:56 Re: Date Problem