PDA

View Full Version : Help building a two level query



nathan2314
04-24-2009, 12:30 PM
Hi,http://www.access-programmers.co.uk/forums/images/smilies/redface.gif
I'm stuck on what seems would be fairly easy but its not quite working right.
Basically, I just want to do a 2 level query. I have a main table with alot of peoples names (first, middle, last). I have an affiliations table with people who are affiliated to the people in the main table. These affiliations are associated with the key from the main table called 'Person_ID'.
Ok so now I want to also find out who all the affiliation people are associated with in the main table.
The reason for this is that we are going to do a social network analysis.
So we would (for example) be able to see a person, say billy bob, that is associated to sue ann, and Rob. and then see that sue ann is also associated to kevin, george, and mike from the main table. etc etc...
This query/table that I need to build needs to have all the information so it can be fed into a analysis software. Whats the best way to build a query to have that information. I guess the query would have multiple entries for a person in the main table then WithIN those entries there would be multiple entries for a particular affiliation which would be because that affiliation is associated to multiple people from the Main table.
I hope that makes sense !
Appreciate any help! http://www.access-programmers.co.uk/forums/images/smilies/smile.gif

CreganTur
04-24-2009, 01:30 PM
Can you post a sample database? It would be a lot easier than thrying to recreate what you're doing (and risk doing it wrong).

stanl
04-26-2009, 06:18 AM
If the data is designed right, probably a simple UNION query. .02 Stan