hi
Here i am giving you one example
declare @name varchar(100)='b',
@dob date='2010-12-10'
if(@name is null and @dob is null)
BEGIN
select * from tblUsers
END
else if(@name is not null and @dob is null)
BEGIN
select * from tblUsers where tblUsers.strFirstName like @name+'%'
END
else if(@name is null and @dob is not null)
BEGIN
select * from tblUsers where tblUsers.dateDateOfBirth=@dob
END
else
BEGIN
select * from tblUsers where tblUsers.strFirstName like @name+'%' and tblUsers.dateDateOfBirth=@dob
END
I hope this idea may help you