Received: from cyclades.com.br (nicole-kidman.cyclades.com.br [200.246.93.9]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA04652 for ; Wed, 22 Sep 1999 13:45:33 -0400 (EDT) (envelope-from paulok@cyclades.com.br) Received: from cyclades.com.br (danielle-winits.cyclades.com.br [200.246.93.41]) by cyclades.com.br (8.8.8/8.8.3) with ESMTP id OAA26006; Wed, 22 Sep 1999 14:54:01 -0300 Message-ID: <37E9163D.BF9C9712@cyclades.com.br> Date: Wed, 22 Sep 1999 14:47:41 -0300 From: Paulo Roberto Kappke Organization: Cyclades Brasil X-Mailer: Mozilla 4.61 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: "Jackson, DeJuan" CC: pgsql-sql@postgreSQL.org Subject: Re: [SQL] Date type select References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit OK DeJuan, but, probably your field's type is datetime and my type is date. If I use your statement, I receive the following message: ERROR: No such function 'date_in' with the specified attributes By the way, I'm using the statement: SELECT * FROM calls WHERE date_in>='$month-01-$year' AND date_in<='$month-31-$year' ORDER BY employee_nbr, date_in And it works fine. Thanks, Paulo K "Jackson, DeJuan" wrote: > > 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 > > > > ************