BF [ 1674906 ] RV_Storage - ORA-01476: divisor is equal to zero
https://sourceforge.net/tracker/index.php?func=detail&aid=1674906&group_id=176962&atid=879332
This commit is contained in:
parent
fed3191700
commit
9af071eae2
|
@ -22,7 +22,7 @@ SELECT s.AD_Client_ID, s.AD_Org_ID,
|
||||||
asi.GuaranteeDate, -- see PAttributeInstance.java
|
asi.GuaranteeDate, -- see PAttributeInstance.java
|
||||||
daysBetween(asi.GuaranteeDate,getdate()) AS ShelfLifeDays,
|
daysBetween(asi.GuaranteeDate,getdate()) AS ShelfLifeDays,
|
||||||
daysBetween(asi.GuaranteeDate,getdate())-p.GuaranteeDaysMin AS GoodForDays,
|
daysBetween(asi.GuaranteeDate,getdate())-p.GuaranteeDaysMin AS GoodForDays,
|
||||||
ROUND((daysBetween(asi.GuaranteeDate,getdate())/p.GuaranteeDays)*100,0) AS ShelfLifeRemainingPct
|
CASE WHEN COALESCE(p.GuaranteeDays,0)>0 THEN ROUND((daysBetween(asi.GuaranteeDate,getdate())/p.GuaranteeDays)*100,0) ELSE NULL END AS ShelfLifeRemainingPct
|
||||||
FROM M_Storage s
|
FROM M_Storage s
|
||||||
INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
|
INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
|
||||||
INNER JOIN M_Product p ON (s.M_Product_ID=p.M_Product_ID)
|
INNER JOIN M_Product p ON (s.M_Product_ID=p.M_Product_ID)
|
||||||
|
|
Loading…
Reference in New Issue