Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Another alternative?

Author  Topic 

Saeed
Starting Member

39 Posts

Posted - 2002-07-29 : 21:38:35
whats the alternative to

Turns = Avg(SoldCost/StockCost) Weighted by SoldCost

for not getting an overflow

Its crashing & have got no idea why.


robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-07-29 : 21:56:22
Well, for one thing, the statement you provided is not SQL. If there are any StockCost values equal to zero, you'll get an error too.

You'll have to post your table structures, some sample data, and the EXACT SQL statement you're using before we can help further.

Go to Top of Page

Saeed
Starting Member

39 Posts

Posted - 2002-07-29 : 22:22:29
They all are int or floats ....
I have not got the description of the table but a set of records
look like this


Day Sold Cost Stock Cost Turns Simple Ratio SC DB
1 100 100 1.0000
2 10 5 2.0000
3 3 1 3.0000
4 3,366 2,654 1.2683
5 4,766 3,689 1.2919
6 200 50 4.0000
Total 8,445 6,499 12.5602 1.299431 1.299431 1.299431
Average 1,408 1,083 2.0934






my signature is one advancer tan my fingeprint .
Go to Top of Page

Saeed
Starting Member

39 Posts

Posted - 2002-07-29 : 22:25:19

is this going to work instead ?

Turn = Sum((SoldCost*SoldCost)/StockCost)/Sum(SoldCost)


my signature is one advancer tan my fingeprint .
Go to Top of Page
   

- Advertisement -