Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why becoming error(operand type mismatch
Message
De
17/09/2005 12:22:44
 
 
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:
01050613
Vues:
17
>Thanks Fabio you reply,
>i am not getting percentage correct
>with out sum result correct but when i use these codes not get corret.
>Can you describe me more

this compute the division, and convert with the two decimal as they are:
TRANSFORM((sum(tobt)/sum(tmax))*100,"##.##") AS PERCENTAGE,;
this compute the division, round the result to two decimal, and convert to char:
TRANSFORM(ROUND((SUM(tobt)/SUM(tmax))*100,2),"##.##") AS PERCENTAGEu;
This is simple and faster, because it round implicitly, but it have a bug and can return wrong values:
STR((SUM(tobt)/SUM(tmax))*100,4,2) AS PERCENTAGEu;
P.S. However, also Round () it is not perfect
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform