Hi all

I have a dilema with a query I created.

Basically I have a search form which is linked to a single record Filter table.
However on my search form I have a section to search for Skills. If I wanted to search for only 1 skill then all is fine but I have 3 listboxes to select up to 3 different skills. The skills table is on a many-many relationship.

Anyway, in the following code the skill search part is failing. Can anyone suggest what I can do?

Code:
SELECT distinct "Employees"."Forename" || ' ' || "Employees"."Surname" , "Employees"."Emp_ID"

FROM "Emp_Filter"
     inner JOIN "Employees" ON (
        (DATEDIFF('yy',"Employees"."Start_date",CURDATE())>="Emp_Filter"."F1" OR "Emp_Filter"."F1" = 0)
         and ("Employees"."PMP" = "Emp_Filter"."F2" OR "Emp_Filter"."F2" = 0)
        AND ("Employees"."Advisory_plus" = "Emp_Filter"."F3" OR "Emp_Filter"."F3" = 0))
    JOIN "Skill_v_Emp" ON ( ("Employees"."Emp_ID" = "Skill_v_Emp"."Emp_ID" and "Skill_v_Emp"."Skill_ID" = "Emp_Filter"."F4" OR "Emp_Filter"."F4" IS NULL))
   JOIN "Skill_v_Emp" ON ( ("Employees"."Emp_ID" = "Skill_v_Emp"."Emp_ID" and "Skill_v_Emp"."Skill_ID" = "Emp_Filter"."F9" OR "Emp_Filter"."F9" IS NULL))
   JOIN "Skill_v_Emp" ON ( ("Employees"."Emp_ID" = "Skill_v_Emp"."Emp_ID" and "Skill_v_Emp"."Skill_ID" = "Emp_Filter"."F10" OR "Emp_Filter"."F10" IS NULL))
     JOIN "Emp_Lang" ON ( ("Employees"."Emp_ID" = "Emp_Lang"."Emp_ID" and "Emp_Lang"."Language_ID" = "Emp_Filter"."F6" OR "Emp_Filter"."F6" is NULL))
where ("Employees"."Role_ID" = 1)
If only 1 of the 3 skills listboxes is selected the above code will work, however 2 or more selected and I get nothing returned.

Any help would be greatly appreciated.

Many thanks in advance.