Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I order the result according to inlist type data
Message
De
13/12/2004 10:48:53
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brésil
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
00968680
Message ID:
00968754
Vues:
5
Hi Ali,

>Hay Eric
>What is maxmimum number for "iff" usage in select command.
>Altun

There's no max number.
But if your issue can to change, there is another approach. Create a UDF that return a number corresponding the customer_id. Thus:
select customer_id,  ;
  MyFunc(customer_id) myNewField ;
  from Customer ;
 where customer_id in (16, 10, 12, 15, 8, 1) ;
  order by myNewField ;
  into cursor curCustormer


Function MyFunc(tnCustomer as Number)
   Do Case
      Case 16
         Return 0
      Case 10
         Return 1
      Case 12
         Return 2
      Case 15
         Return 3
      Case 8
         Return 4
      Case 0
         Return 5
      OtherWise
         Return 100
EndFunc
In this approach when you need modify the values, you can change your UDF instead of the Select statement. I think this mode is more slow than IIF(), but maintenance is more clear and speed.
I hope this helps you.
Bye!
Erick
Força Sempre!
Strength Always!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform