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, 04: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, 06: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.
Be yourself. No one else is as qualified.