Thread: Date Problem
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
Can u plz. elaborate that what do you want to do ? do you want a new date in each row,, or u want to run updaet query or what ? Hargobind Singh -------------------------- Software Project Manager, ACPL Exports, 132, Industrial Estate, Nunhai, Agra - 282 006 (India) Tel: +91 562 2280870-1-2 Fax: +91 562 2344243 ----- Original Message ----- From: "Ramesh PAtel " <ramesh@banas.guj.nic.in> To: <pgsql-admin@postgresql.org> Sent: Thursday, May 01, 2003 12:05 PM Subject: [ADMIN] Date Problem > 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
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