Link to home
Start Free TrialLog in
Avatar of mainrotor
mainrotor

asked on

Need help with SQL Query that should determine whether or not to use a WHERE clause

Hi Experts,
I need help rewriting my SQL Server query to determine whether or not to include a WHERE clause.
I have included my query below.

I want the WHERE clause to be included whenever the @Team variable is greater than 0, and exclude it if it is 0.

How can this be done?

Current Query:
User generated image
thank you for your help,
mrotor
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mainrotor
mainrotor

ASKER

Thank you for your suggestions.  I will try them.

Jim, I will post my code next time.


mrotor