I'm going to pull out the old bag-of-gumballs analogy again.
Where
tsysAssetTypes.AssetTypename Like '%WS%'
And tsysAssetTypes.AssetTypename Like '%NB%'
And tblAssetCustom.State = 1
You've been handed a bag containing a variety of solid-coloured gumballs. You (in the role of the computer, testing conditions) pull out the gumballs, one at a time, and determine whether they meet your conditions. For analogy, I'm going to say the WS machines are red gumballs and the NB machines are green. The active state is superfluous to the analogy, so I'll ignore that.
You pull out the first gumball and test your conditions:
- Is this gumball red?
- AND is this gumball ALSO green?
If both conditions are true, select it for your final collection. If both conditions are not true, discard it.
Pull the next gumball and repeat until the bag is empty.
You hopefully see the problem: any given gumball with never be simultaneously red and green, so none will be selected.
Try adjusting your filter conditions:
Where
(tsysAssetTypes.AssetTypename Like '%WS%' OR tsysAssetTypes.AssetTypename Like '%NB%')
And tblAssetCustom.State = 1
This will select all active assets where the AssetTypename contains
either WS
or NB.
As with algebra, there is a precedence to logical operators, so you need to use parentheses to control the evaluation. Just as multiplication and division take precedence over addition and subtraction, AND takes precedence over OR. In the above, you presumably want to select anything that's active, so that's separated from the check for workstation or notebook name, the same as you would put parens around "A + B * C" if what you wanted was "(A + B) * C".