Forum Replies Created

Viewing 15 posts - 241 through 255 (of 541 total)

  • RE: Concatenate 2 rows based on grouping

    ChrisM@Work (6/20/2012)


    pwalter83 (6/20/2012)


    ChrisM@Work (6/20/2012)


    Are you seeing one row per BOOKING_ID in your output?

    - here's where adequate sample data would have helped 🙂

    yeah, I get only one row per BOOKING_ID...

  • RE: Concatenate 2 rows based on grouping

    ChrisM@Work (6/20/2012)


    Are you seeing one row per BOOKING_ID in your output?

    - here's where adequate sample data would have helped 🙂

    yeah, I get only one row per BOOKING_ID and that...

  • RE: Concatenate 2 rows based on grouping

    ChrisM@Work (6/20/2012)


    pwalter83 (6/20/2012)


    ... I did the following but somehow it doesnt work. Could you please tell what I may be doing wrong:

    ---------------------------------

    CROSS APPLY (

    SELECT

      =

      STUFF(

      (SELECT ', ' +...

    1. RE: Concatenate 2 rows based on grouping

      ChrisM@Work (6/20/2012)


      Thanks Paul: try this...

      SELECT

      MB.BOOKING_ID,

      BOOKING_NUM,

      --------------------------------------------------------

      a.[BOOKING EQUIPMENT],

      --------------------------------------------------------

      GENERAL_COMMODITY_CD + ',' AS GENERAL_COMMODITY_CD -- qualify this column with a table alias so others know which table it's from

      FROM MG_BOOKING MB

      LEFT JOIN (

      SELECT...

    2. RE: Concatenate 2 rows based on grouping

      ChrisM@Work (6/20/2012)


      pwalter83 (6/20/2012)


      ... I have some other tables that are also being used in the query as well. Can that be taken into account as well ?

      Thanks.

      Of course. Can you...

    3. RE: Concatenate 2 rows based on grouping

      SGT_squeequal (6/19/2012)


      the reason you get duplicates is because of your joins are returning courtesan product, can you just explain how you want your results 🙂

      The output should be like this...

    4. RE: Concatenate 2 rows based on grouping

      ChrisM@Work (6/19/2012)


      pwalter83 (6/19/2012)


      ChrisM@Work (6/19/2012)


      Paul, how many rows max will you have to roll up like this? Your example shows two rows - can it be 3, or 4, or n?

      Could...

    5. RE: Concatenate 2 rows based on grouping

      SGT_squeequal (6/19/2012)


      arrr ok well i could only answer in what you put perhaps you can add some DDL to this thread representative data and what you expect the output to...

    6. RE: Concatenate 2 rows based on grouping

      ChrisM@Work (6/19/2012)


      Paul, how many rows max will you have to roll up like this? Your example shows two rows - can it be 3, or 4, or n?

      Could be up...

    7. RE: Concatenate 2 rows based on grouping

      SGT_squeequal (6/19/2012)


      Inner join your table on its self on booking_ID next select the columns you want from table a and then concatenate a+b like so

      select A.BOOKING_ID ,...

    8. RE: ODBC SQL Server Driver Error: Invalid object name

      george sibbald (5/15/2012)


      does the object exist on both servers? Is the owner of the object the same on both servers?

      As far as I know, the login name on both the...

    9. RE: Connecting Reporting services with MS Access database

      anthony.green (5/4/2012)


      guessing its possible as you can create ODBC connection strings for the data sources, so aslong as you created and ODBC DSN which pointed to your access mdb shouldnt...

    10. RE: Issue with duplicate data

      Eugene Elutin (5/3/2012)


      Oh, I see what you mean now.

      Change ORDER BY to:

      ORDER BY [Employee Name]

      ,CAST('01 '+ [Month] + ' ' + CAST([Year]...

    11. RE: Issue with duplicate data

      Eugene Elutin (5/3/2012)


      Oh, I see what you mean now.

      Change ORDER BY to:

      ORDER BY [Employee Name]

      ,CAST('01 '+ [Month] + ' ' + CAST([Year]...

    Viewing 15 posts - 241 through 255 (of 541 total)