Good morning.
I am currently building a report that features Name, Document type, and Expiration Date. The query is based on whether or not the document was ever requested (=yes) and the individual’s role/position. Sadly, due to how the database was designed and how the users have used it, a person may have two roles (Lead Coordinator/Coordinator), and as such, two separate entries (IDs) in the database. However, the users have often only entered in the “Expiration Date” for one of those entries.
Thus, now when I have queries gathering Name, Document, and Expiration Date for each role and then combining them via Union, there may be multiple entries per person, such as:
Smith, John AAA 11-5-2012
Smith, John AAA
Doe, Jane AAA
Doe, Jane AAA 11-11-2011
Is there a way that I am able to keep the row that has more information?
NOTE I do NOT want to due it based on “Date <> Null” because sometimes we may have requested the document but we have not received it yet to enter the Expiration Date and we need to be able to see this data in case we need to request it once again.
Thank you in advance!
Max and Group By may suit:
Where Docs is the name of your table or query.
Input:
Result:
Edit re comment
Edit re comment #2
Note that you should not GROUP By Expiration Date.