Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ordering question
Message
From
07/06/2002 00:40:13
 
 
To
07/06/2002 00:15:39
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00665785
Message ID:
00665788
Views:
31
This message has been marked as the solution to the initial question of the thread.
>in a table I have a field named CustType, which can only have 4 values: Q, W, E, R
>
>I want to sort the table by CustType, but neither in ascending(EQRW) nor descending(WRQE) order, I want the order to be Q,W,E,R. Is it possible?
>
>Are there any VFP commands can do this?
>Is it possible to sort the table in this order, when I'm selecting data with SQL statement?
>Which way is better?

a) Create a cursor CustTypes and populate it with
CustType   OrderPos
-------------------
Q          1
W          2
E          3
R          4
b) Cross tables, using the order set in the types cursor
SELECT Customers.* ;
FROM Customers ;
  INNER JOIN CustTypes ON CustTypes.CustType = Customers.CustType ;
ORDER BY CustTypes.OrderPos
----------------------------------
António Tavares Lopes
Previous
Reply
Map
View

Click here to load this message in the networking platform