I'm trying to create a report that needs to search on multiple fields in the same record and report when there is a match in any of the multiple fields.
The database consists of a single table which lists compositions and other related information. Each composition is one record (the title is one field). Each composition has a unique page number assigned to it (another field-numeric). There are about 700 compositions.
Each composition can have up to four authors. There are four separate fields for authors (i.e. author_1, author_2, author_3, author_4). The authors are listed by last name.
The same author can be listed in a different field for different compositions. For instance, the author named "Red" might be listed in the author_1 field for one composition, in the author_2 field for another composition, and in the author_3 field for yet another. Not all of the author fields are filled for each composition (some are blank when there are less than 4 authors), although they are always filled starting with author_1, then author_2, etc.
I need to be able to generate a report that searches across all four author fields of each record for all instances of each author's name and then returns the page number of each composition in which the author's name is listed.
For instance, assume the following data is in the page number, author_1, author_2, author_3, and author_4 fields.
Record 1 - page 24, Red, Brown, Yellow, (blank)
Record 2 - page 36, Brown, (blank), (blank), (blank)
Record 3 - page 40, Green, Red, (blank), (blank)
Record 4 - page 55, Red, Green, Yellow, (blank)
I'd like to create a report that shows:
Red - 24, 40, 55
Brown - 24, 36
Yellow - 24, 55
Green - 40, 55
I can get close to the results I need using a group break on the author's name field in a report, but I've only been able to figure out how to do that on a single field (i.e. author 1) at a time. A query also comes close, but I can only see how to do that one author's name at a time. As there are about 400 unique authors, I'd like to find another way to approach the report.
I expect that there's a way to do this, but I just have found it yet! Thanks for any suggestions.
Allen
The database consists of a single table which lists compositions and other related information. Each composition is one record (the title is one field). Each composition has a unique page number assigned to it (another field-numeric). There are about 700 compositions.
Each composition can have up to four authors. There are four separate fields for authors (i.e. author_1, author_2, author_3, author_4). The authors are listed by last name.
The same author can be listed in a different field for different compositions. For instance, the author named "Red" might be listed in the author_1 field for one composition, in the author_2 field for another composition, and in the author_3 field for yet another. Not all of the author fields are filled for each composition (some are blank when there are less than 4 authors), although they are always filled starting with author_1, then author_2, etc.
I need to be able to generate a report that searches across all four author fields of each record for all instances of each author's name and then returns the page number of each composition in which the author's name is listed.
For instance, assume the following data is in the page number, author_1, author_2, author_3, and author_4 fields.
Record 1 - page 24, Red, Brown, Yellow, (blank)
Record 2 - page 36, Brown, (blank), (blank), (blank)
Record 3 - page 40, Green, Red, (blank), (blank)
Record 4 - page 55, Red, Green, Yellow, (blank)
I'd like to create a report that shows:
Red - 24, 40, 55
Brown - 24, 36
Yellow - 24, 55
Green - 40, 55
I can get close to the results I need using a group break on the author's name field in a report, but I've only been able to figure out how to do that on a single field (i.e. author 1) at a time. A query also comes close, but I can only see how to do that one author's name at a time. As there are about 400 unique authors, I'd like to find another way to approach the report.
I expect that there's a way to do this, but I just have found it yet! Thanks for any suggestions.
Allen
Comment