Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Per kg rate
Message
From
14/11/2016 03:13:27
 
 
To
14/11/2016 03:10:32
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01643341
Message ID:
01643342
Views:
46
round(cr_amount/weight*qty,2) as kgrt
When a calculation is "wrong", it is often a good idea to compare the wrong result with the correct one by multiplying, dividing, adding or subtracting the two values. The difference will often make you realize what's the mistake.

>Dear..
>
>I am using this data
>
>
>select data1.month,sum(data1.qty) as qty,sum(data1.weight) as weight,sum(data1.amount) as amount,max(data1.kgrt)as kgrt
>	from
>	(select	month(date) as month,qty,qty * weight as weight,round(cr_amount/weight,2)as kgrt,cr_amount as amount from cashsalp
>	where type='P' 
>	union all
>	select 	month(date) as month, qty,qty * weight as weight,round(cr_amount/weight,2)as kgrt,cr_amount as amount from crsalp
>	where type='P')
>	as data1
>	group by data1.month
>
>
>In result, field kgrt is showing wrong data like
>
>144577602/4183502=34.55
>
>but is showing 40537.50
>
>Please help
Previous
Reply
Map
View

Click here to load this message in the networking platform