Hi
I have a Divide by zero error encountered. and have googled it and I have tried to use NULLIF in my syntax. However, I just cannot seem to get the syntax correct.
Could someone advise how the syntax should be please so I can avoid the Divide by zero error message, thanks in advance
I have a Divide by zero error encountered. and have googled it and I have tried to use NULLIF in my syntax. However, I just cannot seem to get the syntax correct.
Could someone advise how the syntax should be please so I can avoid the Divide by zero error message, thanks in advance
Code:
SELECT dbo.PurchaseOrderHeader.DateTimeCreated, dbo.PurchaseOrderHeader.DateExpected, dbo.PurchaseOrderLine.Quantity, dbo.PurchaseOrderLine.QuantityReceived,
dbo.PurchaseOrderLine.Quantity - dbo.PurchaseOrderLine.QuantityReceived AS PoOutstandingQty,
dbo.PurchaseOrderLine.UnitCostPrice * dbo.PurchaseOrderLine.Quantity + dbo.PurchaseOrderLine.TotalAdditionalCost AS PoOriginalValue,
dbo.PurchaseOrderLine.TotalAdditionalCost / dbo.PurchaseOrderLine.TotalVolume AS AdditonalCost, dbo.PurchaseOrderLine.UnitCostPrice AS CostperM3,
dbo.PurchaseOrderLine.TotalAdditionalCost / dbo.PurchaseOrderLine.TotalVolume + dbo.PurchaseOrderLine.UnitCostPrice AS CombineCostM,
dbo.PurchaseOrderHeader.TimberMill, dbo.Supplier.Name, dbo.PurchaseOrderHeader.OrderStatus AS DetermineOUtstandingPO,
dbo.PurchaseOrderLine.LineStatus AS IndetfyOrderComplete, dbo.Product.ProductCode, dbo.Product.Description, dbo.Branch.Name AS Quay,
dbo.Users.Name AS POCreated, dbo.PurchaseOrderHeader.OrderType