drosenkranz
Programmer
I know you can use dtoc() or dtos() but I didn't think that would work for creating a chronological index. For instance:
Using this, wouldn't November and December dates appear after January dates- Then February, March April, etc? 3/12/00 does come after 12/1/00 in an Ascii sort.
Wouldn't all of the dates' years be subject to the same thing. 00 would come before 99, etc?
I thought you'd have to do something "like" this:
Alltrim(Upper(Case_No) +Year(date_comp) + Month(date_comp) + Day(date_comp)
The problem is that this tries to concateneate strings and numbers- and just like strings and dates- FoxPro won't buy it. If I converted these date functions to strings, I'd lose the leading zeroes anyway.
Can anybody answer this or am I missing something here on how VFP is evaluating the dtoc() and dtos() date conversion expressions used in an index?
Using this, wouldn't November and December dates appear after January dates- Then February, March April, etc? 3/12/00 does come after 12/1/00 in an Ascii sort.
Wouldn't all of the dates' years be subject to the same thing. 00 would come before 99, etc?
I thought you'd have to do something "like" this:
Alltrim(Upper(Case_No) +Year(date_comp) + Month(date_comp) + Day(date_comp)
The problem is that this tries to concateneate strings and numbers- and just like strings and dates- FoxPro won't buy it. If I converted these date functions to strings, I'd lose the leading zeroes anyway.
Can anybody answer this or am I missing something here on how VFP is evaluating the dtoc() and dtos() date conversion expressions used in an index?