Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Problem

Status
Not open for further replies.

AkronBoy

IS-IT--Management
May 8, 2001
17
US
My query Company name contains a "&" in the title. When I do a search, nothing is is returned. How do I get around this problem. If I substitute a "-" in the title everything works.

<CFQUERY NAME=&quot;ActionQuery&quot; DATASOURCE=&quot;ResourceCenter&quot;>
SELECT *
FROM ShopContactList
WHERE Company='Anytown Bolts & Screws'
</cfquery>
 
Hmm. When you are using a field like Date in SQL it doesn't work bc Date is a key word. If you put &quot;&quot; around Date then it will work. I am not sure what the syntax would be in your case though.

Also you could rig it using like

<cfif CompanyVar eq &quot;Anytown Bolts & Screws&quot;>
WHERE Company LIKE 'Anytown Bolts%'
<cfelse>
WHERE Company='#CompanyVar#'
</cfif>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top