Re: [GENERAL] using between with dates

2010-04-29 Thread A. Kretschmer
In response to Geoffrey Myers : > 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? Sure, why not, but you have to CAST your STRING into a DATE, o

Re: [GENERAL] using between with dates

2010-04-29 Thread Thom Brown
On 29 April 2010 14:55, Geoffrey Myers 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

Re: [GENERAL] using between with dates

2010-04-29 Thread Szymon Guz
2010/4/29 Geoffrey Myers > 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? > > > This should be fine: ship_date between '04/30/2010'::date AND '04/

[GENERAL] using between with dates

2010-04-29 Thread Geoffrey Myers
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? -- Geoffrey Myers Myers Consulting Inc. 770.592.1651 -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] using between with dates

2010-04-29 Thread Geoffrey
Tom Lane wrote: Geoffrey writes: ship_date between '04/30/2010' AND '04/30/2010' + 14 ERROR: invalid input syntax for integer: "04/30/2010" Can I use between with dates? The problem with that is the parser has no reason to treat the strings as dates, at least not till it comes to consider

Re: [GENERAL] using between with dates

2010-04-29 Thread Tom Lane
Geoffrey writes: > ship_date between '04/30/2010' AND '04/30/2010' + 14 > ERROR: invalid input syntax for integer: "04/30/2010" > Can I use between with dates? The problem with that is the parser has no reason to treat the strings as dates, at least not till it comes to consider the BETWEEN com

Re: [GENERAL] using between with dates

2010-04-29 Thread Adrian Klaver
On Thursday 29 April 2010 6:58:26 am Geoffrey 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? > > -- > Until later, Geoffrey > > "I predict

Re: [GENERAL] using between with dates

2010-04-29 Thread Geoffrey
Geoffrey 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? Got it: ship_date between '04/30/2010' and timestamp '04/30/2010' + interval '14 day' -

[GENERAL] using between with dates

2010-04-29 Thread Geoffrey
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? -- Until later, Geoffrey "I predict future happiness for America if they can prevent the government from wasti