Thanks Dave! Great to know, I do appreciate the information and the
packet_id is a varchar btw.



Bob

-----Original Message-----
From: Dave Phillips [mailto:[email protected]] 
Sent: Wednesday, July 22, 2009 12:02 PM
To: cf-newbie
Subject: RE: query / valuelist woes


Is packet_id a 'varchar' or 'text' field?  If so, do it this way:

<cfquery name="getNewList" datasource="packets">

        SELECT * FROM review_packets

        WHERE id NOT IN
(#listQualify(valueList(tempvoteslist.packet_id),"'") #)

</cfquery>

List qualify will put the 'passed' parameter (in this case a single
quote)
around EACH element of the list.  Also, you do not need to store the
valuelist() result in a variable before using it in the cfquery.  It's
just
extra processing time.  Also, you don't need to pass the 'comma' to
valuelist as that is the default list delimiter.

Try that - it should work for you.

Dave Phillips

-----Original Message-----
From: Imperial, Robert [mailto:[email protected]] 
Sent: Wednesday, July 22, 2009 10:55 AM
To: cf-newbie
Subject: query / valuelist woes


Hi folks,

 

Vacation appears to be over here ;( I've run into something that has me
scratching my head a bit. I have the following code that displays a list
of records, or is supposed to display a list based on those NOT IN
ThisList.  I've dumped ThisList after voting on a couple of records to
test it out, there are 5 total atm for testing and it shows me the money
on both records, however, in the cfloop output only the first record
that shows up in the dump is omitted after voting on 2. Changed the
single quotes to double and on refresh it works???? I am using MySQL5
here btw on Coldfusion MX 7,0,2,142559

 

Any ideas as to why this might be happening or how to correct it? TIA




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4660
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to