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 ''

                      

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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