declare @vc_supplier_name varchar(200) ='' declare @in_supplier_type_id int =2 declare @bt_active bit SELECT a.in_supplier_id, dbo.format_fnc_bit(1, a.bt_active) AS vc_active, b.vc_supplier_type_name, a.in_supplier_type_id, a.vc_supplier_name, dbo.admin_user_fnc_get_name(1, a.in_updatedby_user_id) AS vc_updated_by, a.dt_updated FROM dbo.supplier a INNER JOIN dbo.common_data_vw_supplier_type b ON a.in_supplier_type_id = b.in_supplier_type_id WHERE a.in_supplier_type_id = @in_supplier_type_id AND a.vc_supplier_name LIKE '%' + @vc_supplier_name + '%' AND if(@bt_active <> '') a.bt_active= @bt_active ORDER BY a.vc_supplier_name
AND (@bt_active = 0 OR a.bt_active=1)
@bt_active
a.bt_active
0
1
IF @bt_active = 1 BEGIN --query to get active records ELSE --query to get all records END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)