I have a list of items from various queries. In this example
I have 2
states, MI and IN in the database for this user. I am then
trying to conver
the output of the query into a list to weight against. Its
only getting the
last state entered. Any ideas on why am I not getting all the
states set to
'MyStates', only the last one entered? Thanks.
<cffunction name="GetJobs" access="public"
returntype="Query">
<cfargument name="pcode" type="string" required="yes">
<cfquery name="States" datasource="">
Select prefered_state
FROM state_preference
Where PEOPLE_ORG_CODE_ID = '#arguments.pcode#'
</cfquery>
<cfquery name="Venues" datasource="">
Select prefered_venue
FROM venue_preference
Where PEOPLE_ORG_CODE_ID = '#arguments.pcode#'
</cfquery>
<cfquery name="Areas" datasource="">
Select prefered_practice
FROM practice_preference
Where PEOPLE_ORG_CODE_ID = '#arguments.pcode#'
</cfquery>
<cfset MyStates =
ListQualify(States.prefered_state,"",",","CHAR")>
<cfset MyVenues =
ListQualify(Venues.prefered_venue,"",",","CHAR")>
<cfset MyAreas =
ListQualify(Areas.prefered_practice,"",",","CHAR")>
<!---Begin Job Search--->
<cfquery name="GetJobs" datasource="CareerServices">
Select *
FROM JOBS
WHERE publish = 1
<cfif #MyVenues# NEQ "">AND venue IN
('#myvenues#')</cfif>
<cfif #MyAreas# NEQ "">AND area IN
('#myareas#')</cfif>
<cfif #MyStates# NEQ "">AND state IN
('#mystates#')</cfif>
ORDER BY DatePosted DESC
</cfquery>
<cfreturn GetJobs>
</cffunction>