Bri
Bri

Reputation: 739

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:

Upvotes: 0

Views: 960

Answers (1)

amit_g
amit_g

Reputation: 31240

<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>

Upvotes: 3

Related Questions