I have a job database...
I want to search for all jobs that meet the criteria specified in multiple
fields, I want to include:
>>Practice state if specified
>>Temp, Perm, or both (entered by checkbox on search form-- checking both
would also mean to search for EITHER type of job)
The page that performs the search contains the code listed below...
As it is now, you can search one field or the other and have it return
correct results for that field, but it does not work coreectly to search
BOTH the state and the temp/perm fields...
I need it to return ALL listings that match the state (if specified, and not
left as "SELECT"), as well as returning results for temp jobs (even if the
job listing has BOTH temp and perm available) or for perm jobs (even if the
job listing has BOTH temp and perm available), or,
AND HERE'S WHERE IT GETS TRICKY--->ALL JOBS if I check both boxes-- I don't
want it to return only the jobs that have BOTH types available if I check
both boxes... I want it to return ALL jobs that offer EITHER if I check both
boxes.... But then it has to ALSO match the state specified (if specified
and not just left as "SELECT")
Please help... I know this is possible, and probably even simple.... I
thought I had it, but then lost it, and now I feel like I'm just thinking
about it too hard and can't think about it logically anymore.....
Current Code:
--------------------------
<CFQUERY DATASOURCE="JobBank" NAME="AvailableJobs">
SELECT JobID, PracticeName, Practicecity, Practicestate, Temp, Perm FROM
AvailableJobs
WHERE JobID = JobID
<CFIF PracticeState IS NOT "SELECT">
AND practiceState LIKE '%#PracticeState#%'
</CFIF>
<CFIF Temp IS NOT "">
AND Temp = 1
</CFIF>
<CFIF Perm IS NOT "">
AND Perm = 1
</CFIF>
<CFIF Locum IS NOT "" AND Perm IS NOT "">
or Locum = 1
or Perm = 1
</CFIF>
ORDER BY practicestate,practicecity
</CFQUERY>
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.