Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order by character vs numeric
Message
From
18/10/2009 18:41:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
18/10/2009 06:14:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01429769
Message ID:
01429797
Views:
42
>Hi all,
>I need to order a cursor by a character field that contains numeric values (1,3,4,5,5bis,7..and so on). I cannot change the type of the field, but i want that number 5bis and 6 has a order before than 13. Some trick?
>Thanx

If it is for a report, I would create a calculated field:
select cast(MyCharField as I) as MyNumber, *;
  from MyTable;
  order by 1;
  into cursor Temp
report form ...
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform