pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Michel Chabanne <jeanmichel.chabanne@free.fr>
To: Ramesh PAtel <ramesh@banas.guj.nic.in>
Cc: pgsql-admin@postgresql.org
Subject: Re: Date Problem
Date: Thu, 01 May 2003 10:00:58 +0200
Message-ID: <3EB0D43A.8070407@free.fr> (raw)
In-Reply-To: <3EB10DC4.30066.55AE03@localhost>
References: <3EB10DC4.30066.55AE03@localhost>

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




view thread (3+ messages)

Message-ID: <3EB0D43A.8070407@free.fr>
Permalink:  ../3EB0D43A.8070407@free.fr/
Also on:    postgresql.org/message-id/3EB0D43A.8070407@free.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jeanmichel.chabanne@free.fr, ramesh@banas.guj.nic.in
  Subject: Re: Date Problem
  In-Reply-To: <3EB0D43A.8070407@free.fr>
  References: <3EB10DC4.30066.55AE03@localhost> <3EB0D43A.8070407@free.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox