It should do. I've just tried it in SQL Server 7 and it seemed to.
Try it....let me know what you het. You have to split up the % and the
field name so that SQL can build the string. You will need to add a further
2 quotes if it is a characher field. i.e.
WHERE B.B_xRef LIKE "'%" + A.A_xRef + "%'"
------------------------------------------------------------------
Andrew Ewings
Project Manager
Thoughtbubble Ltd
http://www.thoughtbubble.net
------------------------------------------------------------------
United Kingdom
http://www.thoughtbubble.co.uk/
Tel: +44 (0) 20 7387 8890
------------------------------------------------------------------
New Zealand
http://www.thoughtbubble.co.nz/
Tel: +64 (0) 9 419 4235
------------------------------------------------------------------
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s). Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0)207 387 8890.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 12 December 2000 14:10
To: CF-Talk
Subject: RE: SQL question
I don't believe this will work.
At 01:32 PM 12/12/00 +0000, you wrote:
>SELECT A.A_xRef, B.B_xRef
>FROM Table_a A, Table_b B
>WHERE B.B_xRef LIKE '%' + A.A_xRef + '%'
You could instead do a query to get a list of all the A_xRef
and then do a CFLOOP over them with
<CFLOOP QUERY="MyQuery"
<CFQUERY blah..
SELECT B.B_xRef
FROM Table_b B
WHERE B.B_xRef LIKE '%#MyQuery.A_xRef#%'
</CFQUERY>
</CFLOOP>
As the original poster of the above noted it's obviously not that efficient.
best, paul
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists