Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting the records if
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01323469
Message ID:
01323591
Views:
13
>I want to select the records like
>
>If grade=F
>message="Very poor fail"
>If grade=E
>message="very poor
>endif
>endif
>
>select code,name,grade,;
>CAST(SUM(IIF(grade="F",1,0)) AS I) "Very poor fail"
>CAST(SUM(IIF(grade="E",1,0)) AS I) "Very poor "
>..........
> from student
>thanks
CREATE CURSOR Student (Code I, Name C(50), grade C(1))

INSERT INTO Student VALUES(5,[toto],[E])
INSERT INTO Student VALUES(4,[Mito],[E])
INSERT INTO Student VALUES(5,[Gogo],[F])
INSERT INTO Student VALUES(2,[Mich],[F])
INSERT INTO Student VALUES(1,[bibi],[E])

select code,name,;
       CAST(IIF(grade="F","Very poor fail","Very poor") AS CHAR(50)) AS lcText;
FROM Student;
INTO CURSOR crsTest
BROWSE NORMAL
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform