Hey,
I am trying to create a query that will tell me whether an order was shipped directly to the end user or to our distributors. Some of these distributors have multiple locations. So I have a Ship To Address that I want to test against say 5 other shipping addresses listed for that customer. If none of them match then that would be something directly shipped to the end user. Is there a way I can do it?
It might not be an IIF statement I need but I'm not sure what else I could use.
Thanks
*Update*
Below is a quick simplified example of the two table. The one on the left is the Sales Order table and it contains the address that order is to be shipped to. The one on the right is the customer address table and it shows all the addresses that belong the Bob. I need something that will be able to tell me the Sales Order going to Chris's house is direct to the end users.
SalesOrder# Customer Ship To Address | Customer Ship To Address 83823 Distributor End User's House | Bob Distributor's House | Bob Bill's House | Bob Carol's House | Bob Peggy's House