From 9af071eae2f9d9178ec849b49994b4f236e818ca Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Wed, 7 Mar 2007 08:06:31 +0000 Subject: [PATCH] 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 --- db/ddlutils/postgresql/views/RV_STORAGE.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/ddlutils/postgresql/views/RV_STORAGE.sql b/db/ddlutils/postgresql/views/RV_STORAGE.sql index 33d6c33ec0..41701a40bd 100644 --- a/db/ddlutils/postgresql/views/RV_STORAGE.sql +++ b/db/ddlutils/postgresql/views/RV_STORAGE.sql @@ -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)