I'm having a mental block trying to write a query. I have a list of
numbers (which are in no particular order) and I need to see if just one
of those numbers is in a field in the database which also has a list of
numbers. I figured I'd use a <cfloop> inside my query by I'm having a
little trouble. When I try
<cfquery name="getnews" datasource="#request.MainDSN#" debug>
SELECT n.createdby, n.id, n.category, n.createdon, n.killdate, n.body,
n.viewby
FROM news n
WHERE n.category = 3 AND
n.killdate >= #attributes.currenttime# AND (
<cfloop list="#session.curruser.offices.list#" index="e">
#ListContains(n.viewby, e)# <> 0 OR
</cfloop>
n.id = 1 )
</cfquery>
it cannot resolve "n.viewby". Am I really missing the boat on this one?
Or I do I have a minor mistake? For some reason I think there just must
be a better way.
Sincerely,
John Kivus
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists