Received: from chi-mx.truenorth.com (interlock.truenorth.com [199.221.98.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA75041 for ; Wed, 22 Sep 1999 11:15:02 -0400 (EDT) (envelope-from djackson@cpsgroup.com) Received: from cpsmail.cpsgroup.com (cpsmail.cpsgroup.com [144.210.12.10]) by chi-mx.truenorth.com (8.9.3/8.9.3) with ESMTP id KAA90920; Wed, 22 Sep 1999 10:13:31 -0500 (CDT) Received: by cpsmail with Internet Mail Service (5.5.2448.0) id ; Wed, 22 Sep 1999 10:12:50 -0500 Message-ID: From: "Jackson, DeJuan" To: Paulo Roberto Kappke , pgsql-sql@postgreSQL.org Subject: RE: [SQL] Date type select Date: Wed, 22 Sep 1999 10:12:47 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain template1=> select date_trunc('month', now()); date_trunc ---------------------------- Wed Sep 01 00:00:00 1999 CDT (1 row) template1=> select date_trunc('month', now()) = '9/1/1999'; ?column? -------- t (1 row) Enjoy, DEJ > -----Original Message----- > From: Paulo Roberto Kappke [SMTP:paulok@cyclades.com.br] > Sent: Wednesday, September 22, 1999 8:13 AM > To: pgsql-sql@postgreSQL.org > Subject: [SQL] Date type select > > 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 > > ************