Received: from nogal (root@[194.75.91.82]) by hub.org (8.8.8/8.7.5) with SMTP id GAA14664 for ; Mon, 6 Jul 1998 06:14:38 -0400 (EDT) Received: from master.abrente.es by nogal (SMI-8.6/SMI-SVR4) id MAA01564; Mon, 6 Jul 1998 12:14:29 +0200 Sender: postgres@master.abrente.es Message-ID: <35A0A385.BE14761A@master.abrente.es> Date: Mon, 06 Jul 1998 12:14:29 +0200 From: BD Postgres Reply-To: postgres@master.abrente.es Organization: Master en Telematica X-Mailer: Mozilla 4.05 [en] (X11; I; SunOS 5.5.1 sun4u) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: sql date functions Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello, I am new to postgress and SQL and I don't know how to use the date functions: I need to insert two dates in a row, the first been a week before the second but I don't know how this can be achieved, I have tried: insert into table1 (date1,date2) values('1997-2-3::date','1997-2-3::date + timespan(1 week)'); that is what I think that should be, and all the variations I have imagined, but it hasn't worked, I'm doing this from perl with the DBI interface, but I don't think that to precompute the second date first in perl is a good idea, I prefer to let postgress do it if possible. the errors reported by postmaster are like this: ERROR: Bad date external representation 1/2/2003::date + timespan(1 week) Could somebody tell me which is the correct way to get this working ? Thank you. - Salvador Fandi=F1o. P.S. I have previusly posted this msg in the NOVICE mailing list, but nobody seems to know how to do it there.