I've got a tricky problem to deal with.
First, some background: I work with a directory database. I didn't create the database, and it's VERY frowned upon when I make suggestions to change pieces of it. Needless to say, the database structure in fixed and I cannot change it. Nor am I allowed to go through an interface to edit the data, other than the one they have set up. I've linked the SQL tables to an access database that allows me to manipulate but not change the data itself, meaning I have one route to change the data, and another to view and minipulate it, but they won't let me combine the two for some still unspecified reason.
Now, quite often I'm asked for a list of specific people, usually agency heads, from this database.
Agency heads are found using a ranking system which is the lowest number of in each of two fields being the current head (or fillin). Making sure the agency head is always the same number is those two fields is too time intensive due to the sheer amount of data and my current workload.
The basic structure of what I'm looking for is:
AgencyID - grouped on, TeamID - Min, Ranking - min, EmployeeID
Any thoughts on how to acheive this? Total queries throw the wrong data out since they do each field separately instead of together.
TYIA
First, some background: I work with a directory database. I didn't create the database, and it's VERY frowned upon when I make suggestions to change pieces of it. Needless to say, the database structure in fixed and I cannot change it. Nor am I allowed to go through an interface to edit the data, other than the one they have set up. I've linked the SQL tables to an access database that allows me to manipulate but not change the data itself, meaning I have one route to change the data, and another to view and minipulate it, but they won't let me combine the two for some still unspecified reason.
Now, quite often I'm asked for a list of specific people, usually agency heads, from this database.
Agency heads are found using a ranking system which is the lowest number of in each of two fields being the current head (or fillin). Making sure the agency head is always the same number is those two fields is too time intensive due to the sheer amount of data and my current workload.
The basic structure of what I'm looking for is:
AgencyID - grouped on, TeamID - Min, Ranking - min, EmployeeID
Any thoughts on how to acheive this? Total queries throw the wrong data out since they do each field separately instead of together.
TYIA