|
Hi,
I have 4 tables, Branch, Client, user and userPreferredLocation. Each client has multiple branches and a user has preferred branches they like to visit.
Currently, the query returns branches that require users and doesn't include branches that users like to visit. Is there any way I can modify the query to return all of the branches a user has selected?
Here's my attempt but it doesn't work, can anyone see why?
SELECT Branch.*, Client.Name AS ClientName, Client.Name +' '+ Branch.Name AS Fullname,
PreferredLocation.Location AS Location, User.UserUID As User
From Client INNERJOIN Branch ON Client.ClientUID=Branch.ClientUID
AND Location INNERJOINON Location.UserUID=User.DineerUID
Where Branch.DinerRequired = 1
Orderby Client.Name, Branch.Name
Last edited by drew22299; 11-06-2008 at 12:26 PM..
|