Re: Marking addresses as preferred



On Wed, 2 Jan 2008 23:33:40 -0500, "Matthew" <mappleNOSPAMPLEASE@xxxxxxxx>
wrote:

But what about clients who have one or more addresses, but none are marked
as preferred? How can I make sure that each unique client in
tblClientAddresses has at least one (and preferably only one) of their
addresses marked as Preferred?

SELECT tblClients.ClientID
FROM tblClients
WHERE NOT EXISTS
(SELECT ClientID FROM tblAddresses WHERE tblAddresses.ClientID =
tblClients.ClientID AND Preferred = False);

John W. Vinson [MVP]
.