pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Stupid Monday Problem
4+ messages / 4 participants
[nested] [flat]

* Stupid Monday Problem
@ 2000-04-17 15:28 Kenn Thompson <KThompson@adestagroup.com>
  2000-04-17 15:49 ` Re: Stupid Monday Problem Patrik Kudo <kudo@partitur.se>
  2000-04-17 16:00 ` Re: Stupid Monday Problem kaiq@realtyideas.com
  2000-04-17 16:20 ` Re: Stupid Monday Problem Andrew Perrin - Demography <aperrin@demog.berkeley.edu>
  0 siblings, 3 replies; 4+ messages in thread

From: Kenn Thompson @ 2000-04-17 15:28 UTC (permalink / raw)
  To: pgsql-sql

Ok- here's the problem ( too little coffee?)...

This query runs under Access. I of course change a bit of the SQL ( removed the '#' and have played with quotes), but can't seem to get it to run.

What the #%$^& am I doing wrong here?

Kenn


SELECT oid FROM file_header WHERE expire_date < 04/16/00 
ADODB.Recordset.1 error '80004005' 

Error while executing the query; ERROR: Unable to identify an operator '<' for types 'date' and 'int4' You will have to retype this query using an explicit cast 







^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Stupid Monday Problem
  2000-04-17 15:28 Stupid Monday Problem Kenn Thompson <KThompson@adestagroup.com>
@ 2000-04-17 15:49 ` Patrik Kudo <kudo@partitur.se>
  2 siblings, 0 replies; 4+ messages in thread

From: Patrik Kudo @ 2000-04-17 15:49 UTC (permalink / raw)
  To: Kenn Thompson <KThompson@adestagroup.com>; +Cc: pgsql-sql

Hi.

Dates should be quoted like '04/16/00'
What you're trying to do is to calculate
an integer of value 04/16/00 (which, if
the parser would let it through, would
even generate a division by zero error.)

Regards,
Patrik Kudo

Kenn Thompson wrote:
> 
> Ok- here's the problem ( too little coffee?)...
> 
> This query runs under Access. I of course change a bit of the SQL ( removed the '#' and have played with quotes), but can't seem to get it to run.
> 
> What the #%$^& am I doing wrong here?
> 
> Kenn
> 
> SELECT oid FROM file_header WHERE expire_date < 04/16/00
> ADODB.Recordset.1 error '80004005'
> 
> Error while executing the query; ERROR: Unable to identify an operator '<' for types 'date' and 'int4' You will have to retype this query using an explicit cast



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Stupid Monday Problem
  2000-04-17 15:28 Stupid Monday Problem Kenn Thompson <KThompson@adestagroup.com>
@ 2000-04-17 16:00 ` kaiq@realtyideas.com
  2 siblings, 0 replies; 4+ messages in thread

From: kaiq@realtyideas.com @ 2000-04-17 16:00 UTC (permalink / raw)
  To: Kenn Thompson <KThompson@adestagroup.com>; +Cc: pgsql-sql

try  (add '' around date literal):

SELECT oid FROM file_header WHERE expire_date < '04/16/00' 

On Mon, 17 Apr 2000, Kenn Thompson wrote:

> Ok- here's the problem ( too little coffee?)...
> 
> This query runs under Access. I of course change a bit of the SQL ( removed the '#' and have played with quotes), but can't seem to get it to run.
> 
> What the #%$^& am I doing wrong here?
> 
> Kenn
> 
> 
> SELECT oid FROM file_header WHERE expire_date < 04/16/00 
> ADODB.Recordset.1 error '80004005' 
> 
> Error while executing the query; ERROR: Unable to identify an operator '<' for types 'date' and 'int4' You will have to retype this query using an explicit cast 
> 
> 
> 
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Stupid Monday Problem
  2000-04-17 15:28 Stupid Monday Problem Kenn Thompson <KThompson@adestagroup.com>
@ 2000-04-17 16:20 ` Andrew Perrin - Demography <aperrin@demog.berkeley.edu>
  2 siblings, 0 replies; 4+ messages in thread

From: Andrew Perrin - Demography @ 2000-04-17 16:20 UTC (permalink / raw)
  To: Kenn Thompson <KThompson@adestagroup.com>; +Cc: pgsql-sql

You have to cast the date properly - postgres is interpreting this as 4
divided by 16 divided by 0.  Try:

SELECT oid FROM file_header WHERE expire_date < '04/16/00'::date;

---------------------------------------------------------------------
Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
Department of Demography    -    University of California at Berkeley
2232 Piedmont Avenue #2120  -    Berkeley, California, 94720-2120 USA
http://demog.berkeley.edu/~aperrin --------------------------SEIU1199

On Mon, 17 Apr 2000, Kenn Thompson wrote:

> Ok- here's the problem ( too little coffee?)...
> 
> This query runs under Access. I of course change a bit of the SQL ( removed the '#' and have played with quotes), but can't seem to get it to run.
> 
> What the #%$^& am I doing wrong here?
> 
> Kenn
> 
> 
> SELECT oid FROM file_header WHERE expire_date < 04/16/00 
> ADODB.Recordset.1 error '80004005' 
> 
> Error while executing the query; ERROR: Unable to identify an operator '<' for types 'date' and 'int4' You will have to retype this query using an explicit cast 
> 
> 
> 
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-04-17 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-04-17 15:28 Stupid Monday Problem Kenn Thompson <KThompson@adestagroup.com>
2000-04-17 15:49 ` Patrik Kudo <kudo@partitur.se>
2000-04-17 16:00 ` kaiq@realtyideas.com
2000-04-17 16:20 ` Andrew Perrin - Demography <aperrin@demog.berkeley.edu>

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