Pivot Cross Tab for Text Results

  • Heh... let's see your "low knowledge" do it 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • sheh, mistrusting. ey...

    I'll post it when I've got some time. Will use a tally table to crawl through the records

  • Hi Jeff,

    I was researching cross-tab like products and your postings come as one who knows how.

    I need to produce a of Cases and comma-separated list of Jurisdictions, like this

    Case Jursidiction

    123 AL, CA, CA-FTB, ME

    234 AK, CA, MS

    345 MT, TX, UT, WY

    Given that Cases is a separate table as is Jursidictions, there is a one to many from Cases.caseID to Justisdictions.caseID. This output from this will go into a windows form grid that resembles the example. Cross-tabs are giving me columns for each jursidiction which isn't what I need - jus tneed a plain comma-separated string.

    Can you point me in the right direction please ?

    Best regards,

    Tom

  • Tom Hamilton (7/9/2008)


    Hi Jeff,

    I was researching cross-tab like products and your postings come as one who knows how.

    I need to produce a of Cases and comma-separated list of Jurisdictions, like this

    Case Jursidiction

    123 AL, CA, CA-FTB, ME

    234 AK, CA, MS

    345 MT, TX, UT, WY

    Given that Cases is a separate table as is Jursidictions, there is a one to many from Cases.caseID to Justisdictions.caseID. This output from this will go into a windows form grid that resembles the example. Cross-tabs are giving me columns for each jursidiction which isn't what I need - jus tneed a plain comma-separated string.

    Can you point me in the right direction please ?

    Best regards,

    Tom

    I sure can, Tom... take a look at the following article... It not only gives some working examples to practice on, but it also identifies and tells how to avoid one of the major pitfalls of doing this "contatenation"...

    http://www.sqlservercentral.com/articles/Test+Data/61572/

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Exactly what I needed.

    Blessings on you and yours,

    Tom

  • Thanks for the feedback, Tom. 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 31 through 35 (of 35 total)

You must be logged in to reply to this topic. Login to reply