Hi Forumer'sI was encoutering error when im running this script.I have a zero value in requiredQty which im using to calculate the usage. I tried to use ISNULL and Coalesce but i got an error.any idea to fixed this issue. Thanks.Source Data:Partno |FinishedQty|RequiredQty|NewQty|TranMonth ----------------------------------------------------------------------------SHELL3003110ENLIGHTEN| 943 |943 |39 |2012-05-01 00:00:00.000SALV3003110ENLIGHTEN| 943 |0 |9 |2012-05-01 00:00:00.000.....Select partno , FinishedQty , RequiredQty , NewQty , Usage1=ROUND(ISNULL((NewpartsQty/FinishedQty*100),0),0) , Usage2=ROUND(ISNULL((NewpartsQty/RequiredQty*100),0),0) --, Usage1=ROUND((NewpartsQty/Finishedfone*100),0) --, Usage2=ROUND((NewpartsQty/RequiredQty*100),0) , TranMonthFrom CTE Where NewPartsQty > 0group by partno, FinishedQty, RequiredQty, NewQty, TranMonthOrder by Partno, TranMonth
THank you in advance..jov