It doesn't matter what you use. You have to identify how the user will specify that a parameter isn't going to be used. In a string I assume that is the empty string. For a date, I don't know. But then compare that field to the 'no-parameter' value. Here, I changed the second line to compare it to an empty string:
(p_empid='' and {salaryfield}=p_salary)....