Help
Moderator: Rathinagiri
Help
Help
How to index positive and negative numbers. So put them in a rising order.
When the number is converted to a string, it disappears like this:
-10000.00
20000.00
-5000.00
5000.00
Does anyone have an idea of how to fit properly.
Thanks in advance
How to index positive and negative numbers. So put them in a rising order.
When the number is converted to a string, it disappears like this:
-10000.00
20000.00
-5000.00
5000.00
Does anyone have an idea of how to fit properly.
Thanks in advance
Re: Help
Hi zorpavns,
Try using:
INDEX ON VAL(char_field) to File_NTX.
Regards,
Marin
Try using:
INDEX ON VAL(char_field) to File_NTX.
Regards,
Marin
Re: Help
Zorpavns,
There is a simple solution for this problem. You can simply add a large number to compensate the largest possible negative number.
For example when the field has got 4 positions add 99999 (five times 9).
STR(NumField+99999)
The index would be always positive and the sort order is correct.
Theo
There is a simple solution for this problem. You can simply add a large number to compensate the largest possible negative number.
For example when the field has got 4 positions add 99999 (five times 9).
STR(NumField+99999)
The index would be always positive and the sort order is correct.
Theo
Re: Help
I would create this function:
Your index:
vrs+NEGATEX(sal)
Code: Select all
FUNCTION NEGATEX(NUMERO)
LOCAL RESUL
IF NUMERO<0
RESUL:= "-" + STR(ABS(NUMERO),18,2)
ELSE
RESUL:= STR(NUMERO,19,2)
ENDIF
RETURN RESUL
vrs+NEGATEX(sal)
I get by with a little help from my friends