>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