Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Big Problem in Alpha sort using Stored Procedures
Message
From
05/03/1999 19:05:04
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Big Problem in Alpha sort using Stored Procedures
Miscellaneous
Thread ID:
00194739
Message ID:
00194739
Views:
149
Can someone help me with my problem? I have a table consisting of LName C(20) GName C(20) Grade C(2)
&& Note: Grade contains mixed of Alpha and Numeric
I am trying to sort my table using a function inside my Stored Procedure which will alphasort combining grade and name

My function inside the Stored Proc goes like this:

Function asort
DO CASE
case grade="1"
nretval = 10
case grade="2"
nretval = 12
case grade="3"
nretval = 14
case grade="1b"
nretval = 20
ENDCASE
cOrder = ALLT(STR(nRetVal) + UPPER(ALLT(Lname)+ALLT(gName))
RETURN cOrder

I noticed that if u return an Character it wont sort properly but if u return a numeric the sorting goes well.
Someone have an idea about This... Thanks. I reallt appreciate ur reply.



This is only a sample table that i can come up.
Next
Reply
Map
View

Click here to load this message in the networking platform