Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding the most recently dated record
Message
From
17/09/2000 09:07:42
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
17/09/2000 05:07:47
Jill Derickson
Software Specialties
Saipan, CNMI
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00417373
Message ID:
00417398
Views:
21
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!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform