keepingbusy
Programmer
Hi all
I have two numeric fields in a table CSMORDER
CONSECNUM (n,6) and CONSECYER (n,4) (Example: 123456 and 2005)
I show a list of records from a table in a grid by using the following command:
If I index the table using:
I get
10674 2005
10673 2005
10672 2005
then...
55 2006
54 2006
53 2006 etc
If I change the index on to:
I get
1 2006
2 2006
then...
1 2005
2 2005 etc
If I change the index to:
I get
25 2006
24 2006
23 2006
then...
10400 2005
10399 2005
10398 2005
(The last example is what I'm trying to achieve)
When I issue
in a command window it works fine. However when the records from the table are shown in a grid on a form the CONSECNUM shows
1 2006
2 2006
3 2006
and
1 2005
2 2005
3 2005
What am I missing here guys? I'm sure its staring me in the face!!
Version 6 for this app
Many thanks
Lee
Visual FoxPro Versions: 6 & 9
Operating System: Windows XP
I have two numeric fields in a table CSMORDER
CONSECNUM (n,6) and CONSECYER (n,4) (Example: 123456 and 2005)
I show a list of records from a table in a grid by using the following command:
Code:
muporder=SYS(3) && temp file
SELECT * FROM CSMORDER WHERE COCOMPLT<>"Y" ;
AND COCONFRM<>"Y" ; AND COACCTYN<>"Y" ;
ORDER BY CONSECNUM DESCENDING INTO ;
TABLE muporder+'.dbf'
Code:
INDEX ON CONSECYER+CONSECNUM DESCENDING TAG CONSECNUM
10674 2005
10673 2005
10672 2005
then...
55 2006
54 2006
53 2006 etc
If I change the index on to:
Code:
INDEX ON CONSECYER+CONSECNUM TAG CONSECNUM
1 2006
2 2006
then...
1 2005
2 2005 etc
If I change the index to:
Code:
INDEX ON STR(CONSECYER,4)+STR(CONSECNUM,6) ;
DESCENDING TAG CONSECNUM
25 2006
24 2006
23 2006
then...
10400 2005
10399 2005
10398 2005
(The last example is what I'm trying to achieve)
When I issue
Code:
USE CSMORDER ORDER CONSECNUM
BROWS FIELDS CONSECNUM, CONSECYER
1 2006
2 2006
3 2006
and
1 2005
2 2005
3 2005
What am I missing here guys? I'm sure its staring me in the face!!
Version 6 for this app
Many thanks
Lee
Visual FoxPro Versions: 6 & 9
Operating System: Windows XP