C
Cheese_whiz
Hi,
Sorry for poor title.
I have an app with the main table called 'files'. I also have an entities
table (read: contacts), and a roles table. The roles table is a list of jobs
(roles) an entity might fill in a given file. I also have a junction table
called fileEntityRole.
What I need is a report that lists every file and, IF there is an entity
playing one specific role (DOJ), then I want his name in the record as well.
If there is no such entity listed as playing the role DOJ for a given file,
then I STILL want a record for the file but I just want the field where the
DOJ entity would be to be left blank.
So, I have 10 files in the app, the result should be 10 records....some of
which have an entry for the DOJ field and some of which have a blank for the
DOJ field.
I've tried creating a query with the junction table, the roles table, and
the entities table, and then creating a query including THAT query along with
the Files table. That yields wither one record per file/entity/role defined,
OR if I change the join I can get one record per file/entity/role defined BUT
a MINIMUM of one entry per file (which means if a file doesn't have any
entity/roles defined, I still get one record based on that file.
If I use ="DOJ" in the [RoleName] field, instead of one of the two results I
get above, I get JUST a list of file/entity/roles where the role is "DOJ"
(along with the data from the related file. So, if I have 10 files and only
3 have DOJ roles defined in them, I get three records in the recordset.
Right now, I'm just trying to figure out how to get one record per file and
then a field with the name of a person, if any, playing the DOJ role.
Eventually I'll need to be able to distinguish between two (or more) people
playing the DOJ role in the same file.....one of which will be the 'current'
holder of that role (based on start and end dates) and the others being
'former' holders. I can't get there without first figuring out how to get
just one record per file with the DOJ role holder (if there is one) first.
Any direction? TIA.
Sorry for poor title.
I have an app with the main table called 'files'. I also have an entities
table (read: contacts), and a roles table. The roles table is a list of jobs
(roles) an entity might fill in a given file. I also have a junction table
called fileEntityRole.
What I need is a report that lists every file and, IF there is an entity
playing one specific role (DOJ), then I want his name in the record as well.
If there is no such entity listed as playing the role DOJ for a given file,
then I STILL want a record for the file but I just want the field where the
DOJ entity would be to be left blank.
So, I have 10 files in the app, the result should be 10 records....some of
which have an entry for the DOJ field and some of which have a blank for the
DOJ field.
I've tried creating a query with the junction table, the roles table, and
the entities table, and then creating a query including THAT query along with
the Files table. That yields wither one record per file/entity/role defined,
OR if I change the join I can get one record per file/entity/role defined BUT
a MINIMUM of one entry per file (which means if a file doesn't have any
entity/roles defined, I still get one record based on that file.
If I use ="DOJ" in the [RoleName] field, instead of one of the two results I
get above, I get JUST a list of file/entity/roles where the role is "DOJ"
(along with the data from the related file. So, if I have 10 files and only
3 have DOJ roles defined in them, I get three records in the recordset.
Right now, I'm just trying to figure out how to get one record per file and
then a field with the name of a person, if any, playing the DOJ role.
Eventually I'll need to be able to distinguish between two (or more) people
playing the DOJ role in the same file.....one of which will be the 'current'
holder of that role (based on start and end dates) and the others being
'former' holders. I can't get there without first figuring out how to get
just one record per file with the DOJ role holder (if there is one) first.
Any direction? TIA.