datediff function

From: "Pham, Thinh" <tpham(at)mail(dot)priority(dot)net>
To: "'pgsql-sql(at)postgreSQL(dot)org'" <pgsql-sql(at)postgreSQL(dot)org>
Subject: datediff function
Date: 1999-08-16 16:02:20
Message-ID: 551413BBBB03D111BF880060B01AACCE139F30@home.priority.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi everyone,

Does anyone know if postgres has a function similar to what datediff does in
mssql server? I need it to do an update similar to the one below:

"update schedule set purged = 0 where datediff(day, timein, getdate()) > 30"

I know i could pull the whole table down to my machine, modify the data and
then upload it back, but that's really stupid not to mention what it'll do
to network trafic.

Thank you very much for any answer,
Thinh

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-08-16 17:35:02 Re: [SQL] Anyone recognise this error from PL/pgSQL?
Previous Message Herouth Maoz 1999-08-16 15:52:35 Re: [SQL] Anyone recognise this error from PL/pgSQL?