I have a database with PermitHolders (PermitNum = PK) and DetailedFacilities of each permission holder. There are 2 columns in the tblPermitDetails table
- PermitNum (foreign key)
- FacilityID (integer foreign key to search in the Facility table).
The authorized may have 1 - 29 items at their permission, ei Permission 50 may have a docking station (FacID 4), a paved track (FacID 17), a retaining wall (FacID 20), etc. I need an SQL filter / display, everything, ALL PERMIT #, which have ONLY FILES 19, 20 or 28, not those who have plus "x" others, ... only this is a subset. I have been working on this for 4 days, anyone PLEASE help me? I sent to another BB, but did not get any useful tips.
As Oded suggested, here are the details. There is no PK for the tblPermitDetails table.
Let's say that we have Permitees 1-10; Resolution 1 - John Doe, he has a docking station for boats (FacID 1), Walkway (FacID 4), buoy (FacID 7) and Underbrushing (FacID 19) ... these are 3 entries for permission 1. Resolution 2 Sus Brown , it has ONLY undergrowth (FacID 19), Permit 3 is Steve Tony, it has a boat dock (FacID 1), Walkway (FacID 4), buoy (FacID 7) and Retaining wall (FacID 20), Resolution 4 - Jill Jack, she has Undergrowth (FacID 19) and Retaining Wall (FacID 20). I could go on, but I hope you follow me. I want SQL (for MS Access) to show me ONLY permissions 2 and 4, because they have a combination of identifiers 19 and 20 (both or one or the other), BUT NOT ANYTHING, for example, permission 1, which has # 19, but also has 4 and 7.
, , , , .
, , .. 40, 3000 , SQL , , . , " ! !