Steve-vfp9user
Programmer
Hello
I am looking for advice on how to display a set of records in a specific order within a grid.
A couple of my employees supply statements. Sometimes, they supply more than one statement. My table has a field called WITNO (This is the actual witness number) and WSTATNO (This is the statement number they have provided as this could be 1, 2, 3 etc)
I have tried the following:
The above puts the records in order:
1, 1
1, 2
1, 3
2, 1
So that’s fine because the order is correct however, if I add a record to employee 1 and make it statement 4 (so effectively it would be 1, 4 the order on the grid after adding the record shows:
1, 1
1, 2
1, 3
2, 1
1, 4
Where it should show:
1, 1
1, 2
1, 3
1, 4
2, 1
I have tried reversing the field names on INDEX but do not get the desired result in the grid.
Just one other thing, every time I add a record, the tempfile+’.cdx’ file is deleted and a new one created (I tried this just in case):
What am I doing wrong please?
Steve
I am looking for advice on how to display a set of records in a specific order within a grid.
A couple of my employees supply statements. Sometimes, they supply more than one statement. My table has a field called WITNO (This is the actual witness number) and WSTATNO (This is the statement number they have provided as this could be 1, 2, 3 etc)
I have tried the following:
Code:
tempfile=SYS(3)
SELECT * FROM MYFILE WHERE MASTLINK=mmastlink ORDER BY ;
WITNO, WSTATNO INTO TABLE tempfile+'.dbf'
The above puts the records in order:
1, 1
1, 2
1, 3
2, 1
So that’s fine because the order is correct however, if I add a record to employee 1 and make it statement 4 (so effectively it would be 1, 4 the order on the grid after adding the record shows:
1, 1
1, 2
1, 3
2, 1
1, 4
Where it should show:
1, 1
1, 2
1, 3
1, 4
2, 1
I have tried reversing the field names on INDEX but do not get the desired result in the grid.
Just one other thing, every time I add a record, the tempfile+’.cdx’ file is deleted and a new one created (I tried this just in case):
Code:
INDEX ON WITNO+WSTATNO1 TAG WITNO
What am I doing wrong please?
Steve