Re: Search problem

From: "James R(dot) R(dot) Service" <jservice(at)yahoo(dot)com>
To: pgsql-questions(at)postgresql(dot)org
Subject: Re: Search problem
Date: 2000-04-13 01:11:32
Message-ID: 38F51EC3.3AE9EE5@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oscar wrote:

> I am using apache/php and postgres and I tried a search with dates, but it
> doesn't accept it...
>
> select * from table where date_field < 10-10-2000;
>
> It yells that I cannot use < signs with ints and dates...
>
> Any suggestions ??

Use quotes for *anything* other than numbers. A date is not a number so
try:

select * from table where date_field < '10-10-2000' ;

However, depending on how dates are formatted it might be better written
as

select * from table where date_field < '2000-10-10' ;

--Jim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jigishu P Bhatt 2000-04-13 02:51:57 pgtcl function Error : Tcl_GetChannel
Previous Message omid omoomi 2000-04-13 01:11:10 Re: PHP-Postgres link