We help IT Professionals succeed at work.

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

86 Views
Last Modified: 2017-12-04
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:
Current query being used
thank you for your help,
mrotor
Comment
Watch Question

SQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Nitin SontakkeDeveloper
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thank you for your suggestions.  I will try them.

Jim, I will post my code next time.


mrotor