Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    6

    Unanswered: Problem creating view for cube

    Anyone see a problem with creating this view for a cube??

    The error I get seems to be in line 8 with the sum function, but I see nothing wrong with it.

    CREATE VIEW CarCube AS
    SELECT CASE WHEN (GROUPING(CarType) = 1) THEN 'ALL'
    ELSE ISNULL(CarType, 'Not Known')
    END AS CarType,
    CASE WHEN (GROUPING(Color) = 1) THEN 'ALL'
    ELSE ISNULL(Color, 'Not Known')
    END AS Color
    SUM(Amount) AS TotalAmt
    FROM Inventory
    GROUP BY CarType, Color WITH CUBE

  2. #2
    Join Date
    Nov 2003
    Posts
    94
    You need a comma after Color on the line before

  3. #3
    Join Date
    Jan 2004
    Posts
    6
    lol, sometimes the simplest things are the hardest to find.

    Thanks

  4. #4
    Join Date
    Nov 2003
    Posts
    94
    The people who are really good at finding at simple screw ups are the ones who are really good at making them. ;-)

Posting Permissions

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