Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What may be a problem?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
What may be a problem?
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01522691
Message ID:
01522691
Views:
174
Hi everybody,

I have a strange problem and I'm wondering what I can do to fix it?

As a result of my calculations I receive a cursor with 2 records.
One has 0 as a quantity and 0 as a CostOfGoodsOnHand
and the second record has -1 as quantity and -4.75 as CostOfGoodsOnHand.

I then use this formula

select iif(sum(QuantityOnHand) = 0, 0, sum(CostOfGoodsOnHand)*1.00/sum(QuantityOnHand)) as unit_cost from csr_AvgCost into cursor csrLastCost

and I get 5 as a result instead of 4.75

Do you know what may be a problem here?

Thanks in advance.

UPDATE. I figured it out.
If it's not broken, fix it until it is.


My Blog
Reply
Map
View

Click here to load this message in the networking platform