I might have posted this twice... sorry... but after I posted the first time, I got an 
email that said I wasn't subscribed (even though I was at CFTalk when I posted), and I 
didn't see the first post so, here it goes again.  


Can someone tell me why the following works fine in msaccess, but returns an error in 
CF 4.51, sp2

SELECT accounts.accountid, accounts.streetname
FROM accounts
WHERE accounts.streetname In ("ANCIENT FOREST DRIVE","APPLE HOLLOW COURT")

The cf error is:

------------
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
Hint: The cause of this error is usually that your query contains a reference to a 
field which does not exist. You should verify that the fields included in your query 
exist and that you have specified their names correctly.
SQL = "SELECT accounts.accountid, accounts.streetname FROM accounts WHERE 
accounts.streetname In ("ANCIENT FOREST DRIVE","APPLE HOLLOW COURT")"
-------------

Actually, I am wanting to pass a whole slew of "street names" and replace the hard 
coded ones above with a variable name.  I can pass the variable name 
(selected_streets), and all streets are conformed to be in that list but, I still 
cannot get the query right.

I guess I could build the query with a ton of "OR's" based on what is in the list but 
the IN seems to be a easier to code.

ie:
SELECT accounts.accountid, accounts.streetname
FROM accounts
WHERE (0=0)
AND accounts.streetname = "ANCIENT FOREST DRIVE"
OR accounts.streetname ="APPLE HOLLOW COURT"
OR accounts.streetname ="xxxxx etc"
OR....

Any help is appreciated.

-pat-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Reply via email to