can a variable be turned on or off?
from the below code what if i want to search for all clients and not just dog ppl is there a easy way to search all or do i have to comment the client=@client out from the where statement?
declare @start as date
declare @end as date
declare @client as varchar(50)
declare @Code as varchar(100)
set @start = '2017-05-28'
set @end = '2017-05-30'
set @client = 'dog ppl'
set @Code = 'in,out'
;with cte as (
select sql code
where
entered between @start and @end -- order date created
--finished between @start and @end --order closed
and
client=@client
and Code in(select List from [RAT2].dbo.[tfn_SplitList](@Code,','))