You need to pass the value of the Combobox in @Status
:
Here you need to set conditions like this:
DECLARE @Status varchar(15)
--set the Status
SELECT *
FROM tbl_Location
WHERE (@Status="All"
OR (@Status="Nulls" AND YEAR IS NULL)
OR (@Status="Not Nulls" AND YEAR IS NOT NULL)
)
3
solved NULL Conditons in SQL Server [duplicate]