I have a long list of records and each record has a unique identifer (MRN); I need to identify how many records are duplicates based on the MRN within a 30 day range. So if someone was discharged on a certain date, I want to check if they were readmitted within 30 days of that discharge date.
Here is a sample of the records:
So record is 12345 is duplicate AND it falls within the 30 day date range, therefore I would like to count it; then on another table I would like to pull the MRN's and DRG's associated with the duplicate records... So the tables would display something like this: