Received: from mail.visgen.com (uu-t1-6.visgen.com [216.94.71.6]) by hub.org (8.10.1/8.10.1) with ESMTP id e5MKUi127149 for ; Thu, 22 Jun 2000 16:30:44 -0400 (EDT) Received: from dorin (bay-auto-121 [10.1.18.121]) by mail.visgen.com (8.9.3/8.9.3) with ESMTP id QAA19442; Thu, 22 Jun 2000 16:30:42 -0400 (EDT) Message-Id: <4.2.0.58.20000622162214.00ab5950@pophost> X-Sender: dorin@pophost X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Thu, 22 Jun 2000 16:27:35 -0500 To: Web Manager , pgsql-sql@postgresql.org From: Dorin Grunberg Subject: Re: Wildcard in date field??? In-Reply-To: <39526E9B.418BB807@inter-resa.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Archive-Number: 200006/192 SELECT * FROM my_table WHERE date_part('month', col_name::datetime) = '06' AND date_part('year', col_name::datetime) = '2000'; Looks for more detail in the manual for "date_part" Dorin At 03:52 PM 6/22/2000 -0400, Web Manager wrote: >Hello, > >I need to make a query that will select items that have a date matching >the current month for example. > >For June this means that any day between 2000-06-01 and 2000-06-30 are >ok. To do that I need a wildcard like "%" to replace the actual day in >the date field. > >Ex.: select * from item where date = '2000-06-%%'; > >but that doesn't work... What is the right way? > >Thanks! >-- >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >Marc Andre Paquin