On Dec 12, 10:12 am, Marshall Barton <marshbar...[ at ]wowway.com> wrote:
[Quoted Text] > iamnuwrote: > >On Dec 11, 5:26 pm, Marshall Barton <marshbar...[ at ]wowway.com> wrote: > >>iamnuwrote: > >> >CoName Table has a CompanyName field. > >> >Contacts Table has the name of a Contact, and a MainContact field (yes/ > >> >no). > >> >So the SQL statement would include CompanyName, Contact and > >> >MainContact. > > >> >I want to display (list) those CompanyNames which do not have a > >> >MainContact. > > >> Try using something like: > > >> SELECT CompanyName > >> FROM CoName > >> WHERE Not Exist (SELECT 1 > >> FROM Contacts > >> WHERE Contacts.CoID = CompanyName.CoID > >> And MainContact) > > >I'm getting a syntax error on "Not Exist". Did you mean something > >else? > > No, that's what I meant. Post your query. > > -- > Marsh > MVP [MS Access]
Here is my query...
SELECT CoNameID FROM tblAddresses WHERE Not Exist ((((SELECT 1 FROM tblContacts WHERE tblAddresses.AddrID = tblContacts.AddrID And MainContact)) =False));
|