i think your error is due to a wrong sql statement first of all... you have to
use ZipCode = before each value you are checking fo, not just once like you do.
so you have to change
<cfset Caller.passedreturneddata = Caller.passedreturneddata &
"'#mystruct.zipcode[x]#' or ">
to
<cfset Caller.passedreturneddata = Caller.passedreturneddata &
"'#mystruct.zipcode[x]#' or ZipCode=">
on the other hand, why don't you change your Caller.passedreturneddata to a
comma-delimited list and then use "... AND ZipCode IN
'#Caller.passedreturneddata#' instead?
use the preservesinglequotes function.
InkFasT! - 27 Sep 2006 23:23 GMT
Originally it was a comma delimited list, but frankly I wasn't sure how work
with it that way. So if I understand you that would be...
<cfquery datasource="normmy_denver" name="events">
Select *
From Calendar2
Where fee = No
And Category = #form.category#
And Subcategory = #form.subcategory#
And ZipCode IN '#Caller.passedreturneddata#'
Order by date, time
<cfquery>
Stefan K. - 28 Sep 2006 10:09 GMT
[q][i]Originally posted by: [b][b]InkFasT![/b][/b][/i]
<cfquery datasource="normmy_denver" name="events">
Select *
From Calendar2
Where fee = No
And Category = #form.category#
And Subcategory = #form.subcategory#
And ZipCode IN '#[b]ListQualify(Caller.passedreturneddata, "'")[/b]#'
Order by date, time
<cfquery>[/q]
yes, as long as your Caller.passedreturneddata is a comma-delimited list, you can use it like that.
That worked for the single quotes, but I've never seen this error before. Not
finding anything in Google either.
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] In operator without () in query expression 'fee = No And
Category = Horoscope And Subcategory = Horoscope3 And ZipCode IN
Select * From Calendar2 Where fee = No And Category = Horoscope And
Subcategory = Horoscope3 And ZipCode IN ''80212',' 80212',' 80212',' 80034','
80214',' 80214',' 80214',' 80214',' 80211',' 80033',' 80033',' 80033','
80001',' 80002',' 80002',' 80002',' 80204',' 80295',' 80257',' 80266','
80266',' 80248',' 80217',' 80265',' 80292',' 80215',' 80215',' 80215','
80255',' '' Order by date, time
You need parentheses when using the keyword IN in sql. It's right there in
your error message, didn't you read it?
You should also know that you have changed your logic from what you were
initially attempting to do.
InkFasT! - 28 Sep 2006 19:35 GMT
I read it, I didn't understand it.
I got it to work with a variation of what you guys wrote...
And ZipCode IN (#PreserveSingleQuotes (passedreturneddata)#)
Thanks for all the help!
D.