Date type select - Mailing list pgsql-sql

From Paulo Roberto Kappke
Subject Date type select
Date
Msg-id 37E8D5C8.B1B97489@cyclades.com.br
Whole thread Raw
In response to OID & indexes.  (raptor <raptor@unacs.bg>)
List pgsql-sql
Hi all,

I'm having a problem to make a select statement with a date type field.

I have a table with a field named date_in and this field is a date type.
Well, I need to do a select where the month is 09 and the year is 1999.
I tried:

SELECT * FROM calls WHERE date_in LIKE '09%1999' ORDER BY date_in

or 

SELECT * FROM calls WHERE date_in LIKE '09-__-1999' ORDER BY date_in

or

SELECT * FROM calls WHERE date_in LIKE '09%' AND date_in LIKE '%1999'
ORDER BY date_in

using psql command and I received the following message:

ERROR: There is more than one possible operator '~~' for types 'date'
and 'unknown'
You will have to retype this query using an explicit cast


Could anybody help me ?


Thanks in advance,
Paulo Kappke
Cyclades Brazil


pgsql-sql by date:

Previous
From: Jeff MacDonald
Date:
Subject: Re: [SQL] decimal
Next
From: Tom Lane
Date:
Subject: Re: [SQL] decimal