Forum Replies Created

Viewing 7 posts - 1 through 8 (of 8 total)

  • RE: Pivots using Tally Table

    sorry I didn't tell you guys how i created the Tally table:

    CREATE TABLE [dbo].[Tally](

    [N] [int] IDENTITY(1,1) NOT NULL,

    CONSTRAINT [PK_Tally_N] PRIMARY KEY CLUSTERED

    (

    [N] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE...

  • RE: Pivots using Tally Table

    Alright guys, here's what's going on. the code above worked as long as the data required was for a full year starting from Jan. if i ran the above code...

  • RE: Pivots using Tally Table

    I really do appreciate the help. i am now going through the code to understand EVERYTHING that is going on...haven't worked with COALESCE and some other functions so this...

  • RE: Pivots using Tally Table

    WOW!!!!!!!! Amazing!!!

    Thank you SOOOOOOOOOOOOOOOOOOOOOOOOO much!

    it worked. if you didn't figure that out already there, i said it, it worked! 🙂

    You are awesome! I have been fighting with...

  • RE: Pivots using Tally Table

    What do you get when you execute this against your real data?

    <stuff>,

    SUM(CASE WHEN comm_Month = '1' AND comm_Year = '2010' THEN commPaid ELSE 0 END) AS [1_2010],

    SUM(CASE WHEN comm_Month =...

  • RE: Pivots using Tally Table

    Thank you VERY much! finally something is making sense!

    however, here are the errors i am getting when I try your code:

    Msg 1056, Level 15, State 1, Line 2

    The number of...

  • RE: Pivots using Tally Table

    Sorry about that!

    I have edited it as needed (hopefully)

    and thanks for your help--very much appreciated.

Viewing 7 posts - 1 through 8 (of 8 total)