Dear all,
i have a procedure like bellow,
CREATE PROC USP_ABC
@month int,
@year int ,
as
begin
select * from tbl
where
(@month=0 or (SELECT DATEPART(MM, DOJ) FROM dbo.tbl_param_employee_master as month)= @month)and
(@year=0 or (SELECT DATEPART(yy, DOJ) FROM dbo.tbl_param_employee_master as year)= @year)
END
(@year=0 or (SELECT DATEPART(yy, DOJ) FROM dbo.tbl_param_employee_master as year)= @year)
END
DOJ Date.
here DOJ datatype is date
so please suggest me how to call this query


Saroj Kumar SahuRank #1,766 · 849 reputationPosted Jun 23, 2015, 2:46 AM EDT
Prasad BhagatRank #3,426 · 422 reputationPosted Jun 23, 2015, 2:51 AM EDT
Saroj Kumar SahuRank #1,766 · 849 reputationPosted Jun 23, 2015, 3:15 AM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 23, 2015, 4:00 AM EDT
END