is it possible to have an if statement in a query - so if a value of a variable is 'yes' for example a line is added to the query ?
select * from table
where date >= getDate()
if @Variable = 'yes' then add this line of code to the query
and customerActive = 1