Re: Date Problem - Mailing list pgsql-admin

From Jean-Michel Chabanne
Subject Re: Date Problem
Date
Msg-id 3EB0D43A.8070407@free.fr
Whole thread Raw
In response to Date Problem  ("Ramesh PAtel " <ramesh@banas.guj.nic.in>)
List 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


pgsql-admin by date:

Previous
From: "Hargobind Singh"
Date:
Subject: Re: Date Problem
Next
From: "Ramesh PAtel "
Date:
Subject: Problem in FOR loop