Received: from corvette.mascari.com (dhcp26131045.columbus.rr.com [24.26.131.45]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA26104 for ; Mon, 20 Dec 1999 08:18:25 -0500 (EST) (envelope-from mascarm@mascari.com) Received: from mascari.com (ferrari.mascari.com [192.168.2.1]) by corvette.mascari.com (8.8.7/8.8.7) with ESMTP id IAA15638 for ; Mon, 20 Dec 1999 08:16:35 -0500 Message-ID: <385E2C56.7355C6F2@mascari.com> Date: Mon, 20 Dec 1999 08:17:10 -0500 From: Mike Mascari Organization: Mascari Development Inc X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: [INTERFACES] Pattern matching fun via ODBC Content-Type: multipart/mixed; boundary="------------BEB0A8626630C105888C5C0E" This is a multi-part message in MIME format. --------------BEB0A8626630C105888C5C0E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit --------------BEB0A8626630C105888C5C0E Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Mozilla-Status2: 00000000 Message-ID: <385E2BEC.C33DC787@mascari.com> Date: Mon, 20 Dec 1999 08:15:24 -0500 From: Mike Mascari Organization: Mascari Development Inc X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: David C Hartwig Jr Subject: Re: [INTERFACES] Pattern matching fun via ODBC References: <385DD647.FE504F2B@mascari.com> <385E2559.6E288D01@bellatlantic.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >David C Hartwig Jr wrote: > > Mike Mascari wrote: > > > Hello, > > > > SELECT workorders.workorder, workorders.workorderno, > > equipment.assetno, equipment.controlno > > FROM workorders, equipment > > WHERE equipment.assetno LIKE '%214%' > > AND workorders.equipment=equipment.equipment > > ORDER BY workorders.workorder; > > > > gets re-written by Access as this: > > > > "SELECT "workorders"."workorder","equipment"."equipment" > > FROM "equipment","workorders" > > WHERE (("equipment"."assetno" = '%214%' ) > > AND ("workorders"."equipment" = "equipment"."equipment" ) ) > > ORDER BY "workorders"."workorder" > > I don't have Access 97 installed on any of my systems at this time, so > I cam not verify what I am about to say. But I seem to recall that > Access uses asterisk (*) as the wild card character. I think it is > the MS Jet Engine that is transforming your statements. I believe the > Jet sees the percent (%) character as just another character and so in > its infinite wisdom optimizes for you - transforming the LIKE to an > equal (=). Pretty thoughtful of them. :>( > > I believe (in the context of a LIKE expression) the Jet will transform > your asterisks (*) to percents (%). Unbelievable! You're absolutely correct. I had tried using asterisks with the equality operator, but I had never thought to use both LIKE and asterisks. Wow! Thanks... Mike Mascari --------------BEB0A8626630C105888C5C0E--