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:
teo_sarca 2007-03-07 08:06:31 +00:00
parent fed3191700
commit 9af071eae2
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ SELECT s.AD_Client_ID, s.AD_Org_ID,
asi.GuaranteeDate, -- see PAttributeInstance.java
daysBetween(asi.GuaranteeDate,getdate()) AS ShelfLifeDays,
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
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)