Okay i have four intranet text boxes which i use to filter database values for a specified candidateid
Company | Firstname | Lastname | JobID
I want the page to bring back all records by default for the candidateid and filter accordingly after this. Company/ firstname/lastname will bring back records with the LIKE search but i want to override these fields if a user types in a jobid. I think this works okay at present but the problem i am having is when the user types in 0 for the jobid it just brings back ALLrecords for the candidate instead of jobids with the value of 0. The way i have designed my tables if a jobid wasn't inputted i set the value to 0 instead of leaving it as NULL.
Can someone give me any ideas how to tweak the below search condition to fix this ?
WHERE ca.candidateidfk = @candidateid
(((@jobid = '' OR @jobid IS NULL) AND
c.companyname LIKE ('%'+@company +'%') AND
ct.firstname LIKE ('%'+@firstname +'%') AND
ct.lastname LIKE ('%'+@lastname +'%'))
ca.jobidfk = @jobid)