Re: using between with dates

From: Thom Brown <thombrown(at)gmail(dot)com>
To: Geoffrey Myers <geof(at)serioustechnology(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: using between with dates
Date: 2010-04-29 14:50:35
Message-ID: v2qbddc86151004290750h992c63c6t99cc031e1ddcb797@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29 April 2010 14:55, Geoffrey Myers <geof(at)serioustechnology(dot)com> wrote:

> I'm trying the following:
>
> ship_date between '04/30/2010' AND '04/30/2010' + 14
>
> But this returns:
>
> ERROR: invalid input syntax for integer: "04/30/2010"
>
> Can I use between with dates?
>
>
You need to cast that last date, so:

ship_date between '04/30/2010' AND '04/30/2010'::date + 14

Thom

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Szymon Guz 2010-04-29 14:50:42 Re: using between with dates
Previous Message Geoffrey 2010-04-29 14:26:35 Re: using between with dates