Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why becoming error(operand type mismatch
Message
De
16/09/2005 15:16:37
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Database:
MS SQL Server
Divers
Thread ID:
01050437
Message ID:
01050469
Vues:
24
>Dear all, i am try to using these codes but i have error
SET ENGINEBEHAVIOR 70
>SELECT lcode,sec,descr,examcode, sum(tobt)		as 		tobtt,;
> SUM(tmax)		as tmaxt;
> FROM Examtran;
>WHERE examcode=thisform.code.value .and. scode>=thisform.shiftfm.value .and. scode<=thisform.shiftto.value;
> GROUP BY lcode,sec;
> INTO CURSOR tyu
>brows
>
>SELECT lcode,sec,descr,examcode,tobtt,tmaxt,;
> TRANSFORM((tobtt/tmaxt)*100,"##.##") AS PERCENTAGE;
> FROM tyu;
>WHERE examcode=thisform.code.value .and. scode>=thisform.shiftfm.value .and. scode<=thisform.shiftto.value;
> GROUP BY lcode,sec;
> INTO CURSOR ppp
> SELECT ppp
> brows
>Sorry i am using vfp data not using ms sql server

One is sufficient, remember TRANSFORM don't round():
SELECT lcode,sec,descr,examcode;
 , sum(tobt)		as 		tobtt,;
 , SUM(tmax)		as tmaxt;
 , TRANSFORM(ROUND((SUM(tobt)/SUM(tmax))*100,2),"##.##") AS PERCENTAGE
 FROM Examtran;
WHERE examcode=thisform.code.value .and. scode>=thisform.shiftfm.value .and. scode<=thisform.shiftto.value;
 GROUP BY lcode,sec;
 INTO CURSOR tyu
for the error, remove the where and look if the error happen,
and then fix it one step by step.

uses variables, properties are very slow if the expression is not optimizable.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform