Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I order the result according to inlist type data
Message
From
13/12/2004 10:48:53
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brazil
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00968680
Message ID:
00968754
Views:
4
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!
Previous
Reply
Map
View

Click here to load this message in the networking platform