• You haven't provided enough information to answer this fully, but see if this helps

    DECLARE @t TABLE(ID INT, Item VARCHAR(10), ShipTo VARCHAR(10),FCST01 VARCHAR(10),FCST02 VARCHAR(10),FCST03 VARCHAR(10));

    INSERT INTO @t(ID, Item, ShipTo, FCST01, FCST02, FCST03)

    SELECT 1, NULL, NULL, 20130701, 20130801, 20130901 UNION ALL

    SELECT 1, 'Item1', 'DC01', 10, 0, 0 UNION ALL

    SELECT 1, 'Item2', 'DC01', 1499, 1461, 1142 UNION ALL

    SELECT 1, 'Item3', 'DC01', 37, 35, 0;

    SELECT t1.ID, t1.Item, t1.ShipTo, ca.[Date],ca.Quantity

    FROM @t t1

    INNER JOIN @t t2 ON t2.ID = t1.ID

    AND t2.Item IS NULL

    CROSS APPLY(SELECT t2.FCST01,t1.FCST01

    UNION ALL

    SELECT t2.FCST02,t1.FCST02

    UNION ALL

    SELECT t2.FCST03,t1.FCST03) ca([Date],Quantity)

    WHERE t1.Item IS NOT NULL

    ORDER BY [Date],Item;

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537