Identify sequence break - exclude records

U

UCSD_Ed

Hello. I have a table with records of antibiotics given to a patient across
their stay. Each record has a patient number and a transaction date for the
day the antibiotic was given. I need to identify when a break in the sequence
occurs, and then EXCLUDE any records from the sequence break forward, for the
patient.

Data Sample:
tblAntibiotics

MRN Trans Date
12345678 06/30/2005
12345678 07/01/2005
12345678 07/03/2005 ** (Sequence break)
12345678 07/04/2005 (exclude this record and the previous)
87654321 08/01/2005 New patient so check begins again
87654321 08/02/2005
87654321 08/03/2005

I hope this is clear. Suggestions?

Thanks,
Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top