You probably want to have % signs around your LIKE data. Otherwise it more
or less functions as an =

</rob>

-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 22, 2002 2:09 PM
To: CF-Talk
Subject: search problem


Hello,

I have a simple search code below that is searching an Access table, but it
does not find the fields. Is there something I am missing?

Robert O.

<cfquery name="Getpo" datasource="purchases">
SELECT * FROM purchases where 0 = 0

<CFIF IsDefined("FORM.invoicenumber")>
        And invoicenumber LIKE '#FORM.invoicenumber#'
</CFIF>

<CFIF IsDefined("FORM.contact")>
        And contact LIKE '#FORM.contact#'
</CFIF>

<CFIF IsDefined("FORM.vendor")>
        And vendor LIKE '#FORM.vendor#'
</CFIF>

ORDER BY ID DESC

</cfquery>


Displayed at bottom:

Queries
Getpo (Records=0, Time=16ms)
SQL =
SELECT * FROM purchases where 0 = 0


        And invoicenumber LIKE '2'

        And contact LIKE ''

        And vendor LIKE ''




______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to