Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select with case when
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00516210
Message ID:
00516916
Views:
9
There is another way with ASCAN
Dimension laGradeOrder[7]
laGradeOrder[1] = "A+"
laGradeOrder[2] = "A "
laGradeOrder[3] = "A-"
laGradeOrder[4] = "B+"
laGradeOrder[5] = "B "
laGradeOrder[6] = "B-"
laGradeOrder[7] = "C "

select name, ;
sire1, ;
 ASCAN(laGradeOrder, grade) as gradeorder ;
from master ;
where grade # " " ;
order by name
>Hello All,
>
>I'm trying to use a case when in this select to order classifications. The grades available, in order of importance are A+,A,B+,B,C+,C.
>
>I want to create a select that will translate these so a report can be ordered by importance.
>
>This returns an error message:
>
>
>Select name, sire1, case when grade = "A+" then "1", grade = "A" then "2", grade = "B+" then "3" end as gradeorder from master where grade <> " " order by name
>
>Any help would be appreciated.
>
>Jim Harvey
>jharvey@netrax.net
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform