Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: wildcards for access.
08-20-2014, 05:06 AM #1
- Join Date
- Aug 2010
- High Point, NC
- Thanked 363 Times in 360 Posts
wildcards for access.
I know this isnt an access db forum, but my question has more to do with SQL and support in access for wildcard searches.
My query below seems correct, but its not filtering any data out based on my form field value and the wildcard "%". It returns all records from the table.
<cfparam name="URL.ID" default="1">
<cfparam name="FORM.projectName" default="" type="string">
<cfquery name="plm" datasource="dawnFoods">
SELECT ProductDataSpec.ID, ProductDataSpec.projectName
WHERE ProductDataSpec.ID = ProductDataSpec.ID
<cfif FORM.projectName IS NOT "">
AND ProductDataSpec.projectName LIKE '#FORM.projectName#%'
<!--- All Results Ordered by brand and Item--->
ORDER BY ProductDataSpec.projectName ASC
Not sure I see whats wrong with the sql code. Hope someone can help. Thanks in advanced!Teed
08-22-2014, 07:33 AM #2
Access uses * for wild card, not %.
Though that can depend upon the connection string you used, so if * doesn't work, post your connection string.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.