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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

match record on criteria if none present match different

Status
Not open for further replies.

ali32j

Technical User
Joined
Apr 23, 2007
Messages
97
Location
GB
Hi all

I have a query which i want to filter down, as follows:

code i have at moment is

SELECT Customer.[Name 1], Customer.[R/3 Acc Group]
FROM Customer
WHERE (((Customer.[R/3 Acc Group])="soldto"));

But this will only return soldto, i want it to look for soldto, if none present for each customer then filter the shipto

Is this possible? if so can anyone help?

Thanks

Ali

 
Code:
SELECT Customer.[Name 1]
     , Customer.[R/3 Acc Group]
  FROM Customer
 WHERE Customer.[R/3 Acc Group] IN ('soldto','shipto')

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Hi r937

Thanks for your help

Ali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top