Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ducks in a row
Message
De
09/06/2003 16:41:31
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
09/06/2003 16:36:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00798105
Message ID:
00798107
Vues:
27
This message has been marked as the solution to the initial question of the thread.
>Hi All,
>I have a list of numbers. They are not numeric, just character. When I gather them in an SQL-select statement, they go in that funny order, i.e. 4017 will come right after 40169, etc. How would I the vales in there proper order? Don't say order by because that is what I am doing now.
>Thanks,

As long as the numbers are characters, you will always have this problem (unless they are propery alligned).

Just convert them to numeric, and then use ORDER BY. Example:
select *, val(cNumber) + 000000 as nNumber;
  from MyTable;
  order by nNumber
HTH,

Hilmar.
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform