Search code examples
sqlms-accesscoldfusioncfquery

What is the syntax for concatenating in cfquery with access db


So, I've looked all over the web for this simple answer...and I can't find it.

I am trying to search an access DB via coldfusion query.

<cfquery name = "x" datasource = "cassupport_computers">
SELECT last, first, dept, location, purchasedate, (last + ' ' + first + ' ' + dept + ' ' + location + ' ' + purchasedate AS searchs)
FROM cas_computers
WHERE searchs like '%#form.searchfield#%'
</cfquery>

What am I doing wrong? x:


Solution

  • <cfquery name = "x" datasource = "cassupport_computers">
    SELECT last, first, dept, location, purchasedate, last & ' ' & first & ' ' & dept & ' ' & location & ' ' & purchasedate AS searchs
    FROM cas_computers
    WHERE searchs like '%#form.searchfield#%'
    </cfquery>