Hi,
I created a report to highlight stock items that don't get shipped before an agreed date. We have committed to delivering a minimum of 95% all stock orders within a maximum of five days and all made to order products within 14 days.
At present my report uses the below SQL:
--DECLARE @FINYEAR VARCHAR(4) --DECLARE @FINPERIOD VARCHAR(2) -- --SET @FINYEAR = '2013' --SET @FINPERIOD = '5' SELECT DISTINCT [Order Ref], [Fin Year], [Fin Period], [Cust Group], [Line Of Business], [Requested Delivery Date], [Shipping Date Confirmed], [Created Date], CASE [Made To Order] WHEN 0 THEN 'No' WHEN 1 THEN 'Yes' END AS [Stock Item], [Cust Group], [Line of Business] FROM AGL_SalesAnalysis_2013 WHERE [Fin Period] = @FINPERIOD AND [Cust Group] = 'GB' AND [Line Of Business] = 'STO'
I then output this to the following table:
The table uses the below expression to highlight in red, any orders where the agreed delivery time was missed:
=IIF(Fields!Stock_Item.Value = "No" And DateDiff("d",Fields!Created_Date.Value,Fields!Shipping_Date_Confirmed.Value) > 14,"Red",IIF(Fields!Stock_Item.Value = "Yes" And DateDiff("d",Fields!Created_Date.Value,Fields!Shipping_Date_Confirmed.Value) > 5,"Red","Transparent"))
I now want to create another table that will have one column showing the % or orders that were delivered on time and another showing the number of orders that were late. Can this be done using the same SQL and with an expression or do I need to write a different SQL query?
Cheers
Paul