Will, try thelist = quotedvaluelist(yourquery.fieldname) instead.  That'll
create a list "'item1','item2'...." which can be used in your 2nd where
clause.





-----Original Message-----
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 24, 2006 12:38 PM
To: CF-Talk
Subject: SQL IN() statement in Access

In access, I run a query to get a valueList() from a text field. I use that
list to populate a 2nd query like this

......
WHERE thefield IN ('#thelist#')

This returns nothing because it's formatted like this:

IN ('ITN,CIS,CSC')

Then I tried setting a blank list, looped over the valuelist items, added
some single quotes, then listappend()'d them to the list. 

it threw an error... the generated SQL looked like this:
IN ("ITN","CIS","CSC")

Even tho dumping the list revealed no quotes... just singles. 

I ended up setting some list funtioned variables, looping over, adding
commas... was incredibly silly but it worked. 

What am I missing? 

Thanks,
Will



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244723
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to