September 23, 2021 at 12:55 am
Hello friends,
I believe it should be an easy fix for someone who is good at casting. I appreciate your help.
My calculation is :
CAST(SUM(p.QTY) / SUM (r.QTY) AS decimal (5,2)) AS 'Forecast Accuracy'
p.QTY - Forecast Demand
r.QTY - Last Week Actual
Example
p.QTY = 2596
r.QTY = 2504
Therefore my calculation is
2596/2504 = 1.04
But I have 1.00 as a result
There is an issue with precision I believe. Does someone know how I can adjust the so that the 4 is not dropped.
Please let me know if you know.
Thank you.
September 23, 2021 at 2:09 am
CAST(SUM(p.QTY * 1.0) / SUM (r.QTY) AS decimal (5,2)) AS 'Forecast Accuracy'
by "forcing" one of the operators to be a decimal the results is now a decimal.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy