i have here my search code. i want to search for firstname, and gender, but what if firstname is empty and gender is the one were going to search. but the gender is not filtering they just filter the name.
SELECT --ACCOUNT_CODE --HOSPITAL_CODE MRN ,CONVERT(DATE,BIRTHDATE)BIRTHDATE ,FIRSTNAME ,MIDDLENAME ,LASTNAME ,GENDER ,MARITAL_STATUS ,RELIGION ,OCCUPATION ,ADDRESS1 FROM [dbHIS].[dbo].[PATIENT_INFORMATION] WHERE (FIRSTNAME LIKE @FIRSTNAME) or (GENDER = @GENDER)