Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I make an inner join conditional?

Status
Not open for further replies.

SteveMe

MIS
Joined
Aug 30, 2002
Messages
83
Location
US
Using static SQL and not Dynamic SQL.

I'm thinking somehow someway a case statement would be used. I was able to get this inner join to work for me. However I'd prefer a case statement that would avoid this little trick I deployed. Any help would be greatly appreciated. Thanks


INNER JOIN @Statetbl Ts ON OM.propState = CASE WHEN @State <> 'ALL' THEN Ts.State ELSE OM.propState END

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top