Steve-vfp9user
Programmer
Hello all
I have a table with two numeric fields, JOBNUMB N(6) and JOBYEAR N(4). The jobnumb field stores a rolling number for example 650, 651, 652 and the jobyear field stores the current year e.g. 2017. On the 1st of January, the jobnumb resets back to 1 and the year is added by one e.g. 2018.
In my grid there are two columns for the above and the index tag (already created) is as follows:
When the index is used it shows a list of job number/job year as:
655 2017
654 2017
653 2017
etc etc
854 2016
853 2016
852 2016
So the above is how we want it to show however, we have recently experienced some records out of sync in the list due to users creating the records at different times whereby the job number and job year is allocated.
I have tried the following:
This shows:
653 2017
654 2017
655 2017
etc etc
852 2016
853 2016
854 2016
This shows:
854 2016
853 2016
852 2016
etc etc
655 2017
654 2017
653 2017
This shows:
653 2017
654 2017
655 2017
etc etc
852 2016
853 2016
854 2016
This shows:
854 2016
853 2016
852 2016
etc etc
655 2017
654 2017
653 2017
So my question is, how do I create an index tag which will show my records with the highest job number and latest year first in descending order like this?
655 2017
654 2017
653 2017
etc etc
854 2016
853 2016
852 2016
Thank you
Steve Williams
I have a table with two numeric fields, JOBNUMB N(6) and JOBYEAR N(4). The jobnumb field stores a rolling number for example 650, 651, 652 and the jobyear field stores the current year e.g. 2017. On the 1st of January, the jobnumb resets back to 1 and the year is added by one e.g. 2018.
In my grid there are two columns for the above and the index tag (already created) is as follows:
Code:
SET ORDER TO RECORDNO DESC && This has been created as INDEX ON RECNO() TAG RECORDNO DESC
When the index is used it shows a list of job number/job year as:
655 2017
654 2017
653 2017
etc etc
854 2016
853 2016
852 2016
So the above is how we want it to show however, we have recently experienced some records out of sync in the list due to users creating the records at different times whereby the job number and job year is allocated.
I have tried the following:
Code:
INDEX ON JOBYEAR+JOBNUMB TAG JOBNUMBER
SET ORDER TO JOBNUMBER
This shows:
653 2017
654 2017
655 2017
etc etc
852 2016
853 2016
854 2016
Code:
SET ORDER TO JOBNUMBER DESC
This shows:
854 2016
853 2016
852 2016
etc etc
655 2017
654 2017
653 2017
Code:
INDEX ON JOBNUMB+JOBYEAR TAG JOBNUMBER
SET ORDER TO JOBNUMBER
This shows:
653 2017
654 2017
655 2017
etc etc
852 2016
853 2016
854 2016
Code:
SET ORDER TO JOBNUMBER DESC
This shows:
854 2016
853 2016
852 2016
etc etc
655 2017
654 2017
653 2017
So my question is, how do I create an index tag which will show my records with the highest job number and latest year first in descending order like this?
655 2017
654 2017
653 2017
etc etc
854 2016
853 2016
852 2016
Thank you
Steve Williams