• drew.allen - Tuesday, February 6, 2018 9:46 AM

    I would use the Table Value Constructor version instead of the standard UNPIVOT, because it's more flexible and you need that flexibility here.  I've used a sample where the StartDate is in a datetime format, you can replace that with whatever you're using to handle the dates.

    SELECT ContractName, DATEADD(MONTH, n, StartMonth), [Target]
    FROM tblTarget
    CROSS APPLY
    (
        VALUES
            (0, TargetMonth1),
            (1, TargetMonth2),
            (2, TargetMonth3),
            (11, TargetMonth12)
    ) v(n, [Target])

    Drew

    This seems to have done the trick. thank you so much for your help. Would never have figured that one out for myself.