>I have a vfp 6.0 table that contain date senstive entries:
>
>Table name: SearchTrack.dbf
>search_name
>search_desc
>search_date
>
>The max searches a user can have is (4), so when the user tries to search a 5th time, i want to grab the record with the latest search date and simply replace the search name, desc fields as well as update the search_date field with the new system date.
I assume you mean you want to earliest, not the latest, but if you really mean latest, flip the sign here.
UPDATE SearchTrack ;
SET Search_Name = m.NewName, ;
Search_Desc = m.NewDesc, ;
Search_Date= DATETIME() ;
WHERE Search_Date = (SELECT MIN(search_date) FROM SearchTrack)
I've assumed that Search_Date is actually a DateTime, so that it can be used to actually uniquely choose the oldest. If it's just a date, you have to deal with the possibility of having two records with the same value. (Technically, that's true for datetime as well, but that seems unlikely in your use case.)
Tamar