You shouldn't have the commas in there- you're using and clauses so try
WHERE ReqNO > 0
<CFIF #form.ReqNo# NEQ "0">
AND (ReqNo='#ReqNo#')
</CFIF>
<CFIF #form.FIRSTNAME# NEQ "0">
AND (FIRSTNAME LIKE '#FIRSTNAME#%')
</CFIF>
and on and on and on.....
-----Original Message-----
From: James Blaha [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 2:29 PM
To: CF-Talk
Subject: SQL Help
Can any one help me out here? I'm having a problem getting this query to
work with putting in the proper commas when necessary in myWHERE clause
for the SQL statement.
James Blaha
<CFQUERY name="JobApplicants" datasource="ABC">
SELECT *
FROM HRWebAgent.tApply
WHERE ReqNO > 0
<CFIF #form.ReqNo# NEQ "0">
AND (ReqNo='#ReqNo#'),
</CFIF>
<CFIF #form.FIRSTNAME# NEQ "0">
AND (FIRSTNAME LIKE '#FIRSTNAME#%'),
</CFIF>
<CFIF #form.LASTNAME# NEQ "0">
AND (LASTNAME LIKE '#LASTNAME#%'),
</CFIF>
<CFIF #form.APPLIED_DATE# NEQ "0">
<!--- Dates go in order of old:recent i.e. BETWEEN
'11/4/2000' AND '6/18/2001' --->
AND (APPLIED_DATE BETWEEN '#back_date_listed2#' AND
'#now_date2#'),
</CFIF>
<CFIF #form.Desired_Position# NEQ "0">
<!--- Desired_Position IN ('Briarcliff','New York') --->
AND (Desired_Position IN
(#ListQualify(Form.Desired_Position,"'")#)),
</CFIF>
</CFQUERY>
______________________________________________________________________
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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists