Hi. I’m trying to write a report where I am using two queries. The first query captures basic information such as the MRN and name. The second query captures the admit dates, MRNs, and their diagnosis for each admit date. I am trying to bring the most recent diagnosis over to the first query using the max admit date for each patient using the merged MRN. I am able to get the max admit date for each patient, but it is not bringing over any data when I try to bring the diagnosis over to the main tab. Below are my two formulas I put together. The max admit formula seems to work, but the max diagnosis formula brings over blank rows. Thanks in advance for any help you can provide.
Query 1
Person Name | MRN | Age | Max Diagnosis |
---|---|---|---|
Mike | 98 | 18 | |
Tom | 32 | 18 | |
Steve | 23 | 20 | |
Sal | 21 | 19 | |
Fred | 103 | 18 |
Query 2
Variables
Max Admit Date
=Max([Admit Date & Time]) In ([MRN])
Max Diagnosis
=([Diagnosis Description]) Where ([Max Admit Date]=[Admit Date & Time]) In ([MRN])