Re: date question

From: lucas(at)presserv(dot)org
To: Judith Altamirano Figueroa <jaltamirano(at)correolux(dot)com(dot)mx>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: date question
Date: 2005-11-03 17:22:29
Message-ID: 20051103142229.d5bfubfxu8mc0cc0@www.presserv.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Quoting Judith Altamirano Figueroa <jaltamirano(at)correolux(dot)com(dot)mx>:
> Hi everybody, in Postgres 7.0.2 I have the next query:
> SELECT * from clientes_proceso where fecha_mod::date <= now() -1;
> but in version 8.0.1 returns the next error:
> ERROR: The operator doesn't exist: timestamp with time zone - integer
> How can drop a day to now()??

Try using "now()::date", or "interval". Like:
select * from clientes_proceso where fecha_mod::date <= now()::date -1;
or:
select * from clientes_proceso where fecha_mod::date <= now() - '1
day'::interval;
---
Lucas

In response to

  • date question at 2005-11-03 16:17:52 from Judith Altamirano Figueroa

Browse pgsql-sql by date

  From Date Subject
Next Message zackchandler 2005-11-03 17:58:29 Design question: Scalability and tens of thousands of tables?
Previous Message Michael Glaesemann 2005-11-03 17:22:24 Re: date question