How do you check to see if query results contain a string?
Posted on 2008-10-02
I have two queries; the first one simply returns a list (of, say, all letters of the alphabet) and the second returns a varying number of letters. What I want to do is print out the results of the first query highlighting the ones that are contained in the second query. I'm guessing it would be done something like the following:
<cfif [qSelectLetters contains qAlphabet.letter]><b></cfif>
<cfif [qSelectLetters contains qAlphabet.letter]></b><cfif>
But I'm unsure of how to phrase the part in the brackets. I've done it by setting a string (looping through query 2, to give something like "a,c,g,w" and seeing if that string contains qAlphabet.letter, but it seems like that would be excessively huge if the queries were involving blocks of text, not just letters.