Just use "AND," not "AND WHERE." For example:
<cfquery name="ListElement" datasource="database" dbtype="ODBC">
SELECT *
FROM profiles
WHERE strUsername = '#auth#'
AND strSelect = 'D:\test'
</cfquery>
This will return only those records where strSelect EXACTLY matches
"D:\test." If a record contains "D:\test\someValue" it will NOT be
returned. If you want to find anything that contains that value, use the
LIKE operator with the "%" wildcard as in:
strSelect LIKE '%D:\test%'
--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 625-9191
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/
> -----Original Message-----
> From: FlashGuy [mailto:flashmx@;rogers.com]
> Sent: Tuesday, November 05, 2002 8:09 AM
> To: CF-Talk
> Subject: <cfquery...> Match text and display to template
>
>
> Hi,
>
> Is there a way to do the following with a query. I'm running CF
> and MySQL. I want to display from the field "strSelect" when I
> get a match on "d:\test" only even though the
> field could contain "d:\mywork" and "d:\documents" Presently I'm
> displaying *everything* from the strSelect field.
>
> Here is my query:
>
> <cfquery name="ListElement" datasource="database" dbtype="ODBC">
> SELECT *
> FROM profiles
> WHERE strUsername = '#auth#'
> </cfquery>
>
>
> Can I do something like:
>
> <cfquery name="ListElement" datasource="database" dbtype="ODBC">
> SELECT *
> FROM profiles
> WHERE strUsername = '#auth#'
> AND
> WHERE strSelect = 'D:\test'
> </cfquery>
>
> The idea here is to match/list only the occurences with "d:\test"
> in the field?
>
>
>
>
>
> ---------------------------------------------------
> Colonel Nathan R. Jessop
> Commanding Officer
> Marine Ground Forces
> Guatanamo Bay, Cuba
> ---------------------------------------------------
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm