You told that you have to filter by either date or supplier id
So use the following in procedure
Pass the Supplier code or two dates(must) from UI.
@Code nvarchar(100)=null,
@FromDate datetime=null,
@ToDate datetime=null,
@FormName varchar(max)
AS
BEGIN
if(@FormName='Supplier')
Begin
if(@Code <> null and @Code !='')
SELECT ROW_NUMBER () over(order by sup_id )as SINO,sup_id, sup_code,sup_name,sup_phone,convert(varchar,sup_date,103)AS Date From tbl_SupplierMaster
where (sup_date between @FromDate and @ToDate)
AND sup_active='True' AND sup_code = @Code
else
SELECT ROW_NUMBER () over(order by sup_id )as SINO,sup_id, sup_code,sup_name,sup_phone,convert(varchar,sup_date,103)AS Date From tbl_SupplierMaster
where (sup_date between @FromDate and @ToDate)
AND sup_active='True'
End
END
Hope it helps