Jill,
When I need to get to the latest appointment for a patient I use the following for my index:
STRING(PatientId) + DTOS(VisitDate) DESCENDING
The records come out like:
PatientId VisitDate
3 {01/03/2000}
3 {01/02/2000}
3 {01/01/2000}
2 {01/03/2000}
2 {01/01/2000}
If I'm selecting data for a report I can order by PatientId ASCENDING and VisitDate DESCENDING since the above isn't nice for a report.
>Bill,
>
>Thanks...yes that was a way I've done it previously...guess I was thinking there must be a more elegant way, but, oh well. Thanks again.
>
>J
>
>>I think that you will get the CaseAAGsID for the lowest record in the table for each CourtCasesID. (Not the CaseAAGsID for the max(date) record) You can do this with two steps.
>
>>Not too elegant but it works!