Results 1 to 1 of 1

Thread: Pivot View

  1. #1
    Join Date
    Oct 2010
    Posts
    2

    Unanswered: Pivot View

    Having a issue with my Pivot returning the same values for all rows. I think the problem is in the bold... Ideas?

    View with all my data to be used in the Pivot.

    SELECT dbo.audit_Click.ReportID, dbo.audit_Click.movieID, dbo.audit_Click.clickValue, dbo.audit_Click.clickItem, dbo.Products.userCreated,
    dbo.Products.Name, dbo.Products.ProductID, dbo.Products.accountID, dbo.Products.ImagePath, dbo.Products.Approved, dbo.Products.datetimeCreated,
    dbo.Products.datetimeStart, dbo.Products.datetimeEnd
    FROM dbo.Products INNER JOIN
    dbo.MovieProducts ON dbo.Products.ProductID = dbo.MovieProducts.ProductID INNER JOIN
    dbo.audit_Click ON dbo.MovieProducts.movieID = dbo.audit_Click.movieID



    SELECT accountID, productID, userCreated, Approved, datetimeStart, datetimeEnd, Name, imagePath, [Product] AS Detail, [Share] AS Share,
    [Button1] AS Button1, [Button2] AS Button2, [Tagit] AS Tagit, [VideoinVideo] AS VideoINVideo
    FROM (SELECT accountID, productID, userCreated, Approved, datetimeStart, datetimeEnd, Name, imagePath, ClickItem, ClickValue
    FROM vw_ActiveOverlayProducts) ps PIVOT (Count(ClickValue) FOR ClickItem IN ([Product], [Share], [Button1], [Button2], [Tagit], [VideoInVideo])) AS pvt
    WHERE userCreated = '8d4f3725-fffc-40c7-b11a-7e69328775b5'


    Data returned from pivot view
    7afb93c1-181a-491f-a828-3b34c5f30a49 51aa2743-dbb4-4e71-8a14-996856df3b36 8d4f3725-fffc-40c7-b11a-7e69328775b5 Yes 10/11/2010 2:09:00 PM 11/19/2010 1:48:00 PM Overlay Title 0c976b7f-0951-44ee-8718-0b305e8e5918.jpg 30 0 8 9 0 0


    7afb93c1-181a-491f-a828-3b34c5f30a49 95191608-3be2-4653-983c-5add066278c9 8d4f3725-fffc-40c7-b11a-7e69328775b5 Yes 10/7/2010 1:31:00 PM 11/19/2010 9:37:00 AM Big Bird 95191608-3be2-4653-983c-5add066278c9.jpg 30 0 8 9 0 0
    Last edited by warmdownhere; 10-22-10 at 12:22.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •