As it's a list anyway, why don't you j7ust output the list instead of looping over it and outputitng each item.
WHERE journoid IN (#attributes.journoid#) Russ Michaels Macromedia/Allaire Certified ColdFusion Developer Satachi Internet Development Unit 2, 7A Plough Yard London EC2A 3LP Phone: 0870 787 3610 Tech Support: 0906 9607800 FAX: 0709 2212 636 http://www.satachi.com email general: [EMAIL PROTECTED] email support: [EMAIL PROTECTED] Join our ColdFusion Developer discussion lists. Send an e-mail to [EMAIL PROTECTED] > -----Original Message----- > From: Dave Phipps [mailto:[EMAIL PROTECTED]] > Sent: 27 January 2003 16:13 > To: ColdFusion User group > Subject: [ cf-dev ] Spot the problem - IN() > > > Hi, > > I am running into a problem with a query that is looking at a > list to get > the records for items in the list. I have three queries all > running very > similar code and the last query is not putting the comma in > between the > list items and therefore is returning no records. > > The line of code is: > > WHERE journoid IN (<cfloop index="d" > list="#attributes.journoid#">'#d#'<cfif > ListLast(attributes.journoid) NEQ > d>, </cfif></cfloop>) > > In the debug I see the two journoid values listed but without a comma > separating them. > > I have another query which uses this code: > WHERE journoNatOpt.natOptid IN(<cfloop index="c" > list="#valuelist(storyNatOpt.natOptid)#">'#c#'<cfif > ListLast(valuelist(storyNatOpt.natOptid)) NEQ c>, </cfif></cfloop>) > > As you can see there is not a great deal of difference > between the two > lines except that the first one does not work. > > Can anyone spot what I have missed? > > Cheers > > Dave > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] For human help, e-mail: > [EMAIL PROTECTED] > > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
