2
Answers

MS SQL Decimal Place problem. Should be so Simple.

Chris Dude

Chris Dude

11y
1.4k
1
Hi All, I have come across an odd problem.

SELECT        Customer, QtyRejected, Year, Month, QtyShipped, CAST(SUM(QtyRejected) / SUM(QtyShipped) * 1000000 AS Numeric(9, 2)) AS PPM
FROM            dbo.MasterRejects_and_CCARShipped_Join
GROUP BY Customer, QtyRejected, Month, Year, QtyShipped

The calculation is 45 / 322524 * 1000000. The answer should be 139.52. The SQL server returns 139.00

I cannot see what I am doing wrong. Could someone please help?

Answers (2)