Query Help

D

DS

I have a Table that has this...
tblPrivAssigned
SecurityID
PrivID

And another Table that has...
tblPrivileges
PrivID
PrivName

I then have 2 Listboxes...
One is ListAssigned the other is ListNotAssigned.

The problem is this.
I want the Assigned Privileges to show up in the ListAssigned List and
the Not Assigned to show up in the ListNotAssigned. This only works if
there are records in the tblPrivAssigned table. So I'm doing something
wrong here. How can I get the ListNotAssigned List to populate even if
there are not records to be found in the tblPrivAssigned Table?
Thanks
DS
 
J

Jeff L

Select a.PrivID, PrivName
From tblPrivileges a Left Outer Join tblPrivAssigned b ON a.PrivID =
b.PrivID
Where b.PrivId IS NULL

This will give you all records from tblPrivileges that are not in
tblPrivAssigned.
 
D

DS

Jeff said:
Select a.PrivID, PrivName
b.PrivID
Where b.PrivId IS NULL

This will give you all records from tblPrivileges that are not in
tblPrivAssigned.
Thanks! Just what I needed.
DS
 
Top