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:
01323475
Views:
10
>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

select CAST(SUM(IIF(grade="F",1,0)) AS I) as Failed,
CAST(SUM(IIF(grade="E",1,0)) AS I) as Poor.. from Studens group by 1,2,3

You can not have fields with spaces in them. You can create a temp database (see CREATE DATABASE command in help), create table with captions and append from the cursor into this table. This way your fields would have captions.

However, you can just use these captions in the UI (report, grid captions, etc.). You don't need to have them in the table, in the table you may have fields as
iE, iF, etc. or cntE, cntF, etc.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform