I have lot of data and for sample purpose mention below data
d1 date OL
N 2012-03-09 00:00:00.000 NULL
No 2011-09-26 00:00:00.000 OL
N 2012-01-26 00:00:00.000 NOL
N 2012-03-07 00:00:00.000 NOL
yes 2012-02-23 00:00:00.000 NULL
i need to wrire sp like
Create proc dbo.usp_all_property_search
(@type varchar(2))
as
begin
select * from tbl where ol is
select case @type
when 'o' then null
else
not null
end
end
Plz help me .
You’re over complicating it: