C
cd6109
I'm using Access 2002 and need to distinguish admission dates from a series
of other service dates. This could easily be done by grouping ClientId and
using Min([Service Date] if each client had only one admission; however, I
need the query to recognize when there is a break in service (discharge) and
then return the value for the new re-admission date for the next group of
records while keeping the admission date the same for the first series of
records. The data looks like this:
ClientId Service Date Admission Date
00044 12/22/06
00044 12/23/06
00044 12/24/06
00044 12/25/06
00044 01/09/07
00044 01/10/07
00044 04/18/07
00122 10/03/06
00122 10/04/06
00989 03/07/07
00989 03/08/07
00989 04/01/07
For ClientId 00044, I need to populate Admission Date with 12/22/06 for the
first series of records, 01/09/07 for the second set of records, and 04/18/07
for his last record. ClientId 00122 would need to have Admission Date be
10/03/06. ClientId 00989 would need to have Admission Date be 03/07/07 on
the first two records and 04/01/07 for the final record.
What's the best way to tackle this?
of other service dates. This could easily be done by grouping ClientId and
using Min([Service Date] if each client had only one admission; however, I
need the query to recognize when there is a break in service (discharge) and
then return the value for the new re-admission date for the next group of
records while keeping the admission date the same for the first series of
records. The data looks like this:
ClientId Service Date Admission Date
00044 12/22/06
00044 12/23/06
00044 12/24/06
00044 12/25/06
00044 01/09/07
00044 01/10/07
00044 04/18/07
00122 10/03/06
00122 10/04/06
00989 03/07/07
00989 03/08/07
00989 04/01/07
For ClientId 00044, I need to populate Admission Date with 12/22/06 for the
first series of records, 01/09/07 for the second set of records, and 04/18/07
for his last record. ClientId 00122 would need to have Admission Date be
10/03/06. ClientId 00989 would need to have Admission Date be 03/07/07 on
the first two records and 04/01/07 for the final record.
What's the best way to tackle this?