Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why becoming error(operand type mismatch
Message
From
17/09/2005 12:22:44
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01050437
Message ID:
01050613
Views:
13
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform