VFP9, Win7.
I have a table containing details of visits to various sites around the country. The field REF (C,9) represents the site, and VISITDATE (D) is, unsurprisingly, the date of a visit. I want to browse the visits in a grid ordered by REF alphabetically, starting with the 'A's, but in date order within REF, with the most recent visit date at the top, thus:
A123 20/06/11
A123 15/01/11
B321 22/06/11
C456 10/06/11
C456 19/02/11
C456 12/12/10
I can index on REF + DTOS(VISITDATE) and by default that gives me Alpha order on REF but oldest visit date first, so thats no good. I could SQL SELECT * ... ORDER ON VISITDATE DESC into another table, then index that on REF, but I'd rather just stick to the original table, since the users need to be able to edit the data having selected a record via the grid.
I keep thinking that there is something really obvious and simple that I'm not seeing, and if so, a big sorry to everyone, but my brain has turned to mush on this. Suggestions please.
I have a table containing details of visits to various sites around the country. The field REF (C,9) represents the site, and VISITDATE (D) is, unsurprisingly, the date of a visit. I want to browse the visits in a grid ordered by REF alphabetically, starting with the 'A's, but in date order within REF, with the most recent visit date at the top, thus:
A123 20/06/11
A123 15/01/11
B321 22/06/11
C456 10/06/11
C456 19/02/11
C456 12/12/10
I can index on REF + DTOS(VISITDATE) and by default that gives me Alpha order on REF but oldest visit date first, so thats no good. I could SQL SELECT * ... ORDER ON VISITDATE DESC into another table, then index that on REF, but I'd rather just stick to the original table, since the users need to be able to edit the data having selected a record via the grid.
I keep thinking that there is something really obvious and simple that I'm not seeing, and if so, a big sorry to everyone, but my brain has turned to mush on this. Suggestions please.