pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lucas@presserv.org
To: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
Cc: pgsql-sql@postgresql.org
Subject: Re: date question
Date: Thu, 03 Nov 2005 14:22:29 -0300
Message-ID: <20051103142229.d5bfubfxu8mc0cc0@www.presserv.org> (raw)
In-Reply-To: <1131034672.3600.74.camel@Desarrollo>
References: <1131034672.3600.74.camel@Desarrollo>

Quoting Judith Altamirano Figueroa <jaltamirano@correolux.com.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




view thread (15+ messages)

Message-ID: <20051103142229.d5bfubfxu8mc0cc0@www.presserv.org>
Permalink:  ../20051103142229.d5bfubfxu8mc0cc0@www.presserv.org/
Also on:    postgresql.org/message-id/20051103142229.d5bfubfxu8mc0cc0@www.presserv.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lucas@presserv.org, jaltamirano@correolux.com.mx
  Subject: Re: date question
  In-Reply-To: <20051103142229.d5bfubfxu8mc0cc0@www.presserv.org>

* 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