String to Table passing two delimiters split in ssrs reports












0















Need to display string data to table using ssrs reports.
Have data in new_details field as string format



PO SEQ Country
65774 1 PE
27039 1 PA
27040 1 PA
27041 1 PA
27042 1 PA
27043 1 PA
27044 1 PA
27045 1 PA



need to convert as this data into table. i tried below query but it not worked.



declare @ModelID VARCHAR(max)

--make sure to use brackets
set @ModelID = (select new_details from new_order
where newid='857647')

select @ModelID

DECLARE @p VARCHAR(50)
select * from dbo.SplitStringtoTable(@ModelID,' ')


Now getting output as



Item
PO
SEQ
Country 65774
1
PE 27039
1
PA 27040
1
PA 27041
1
PA 27042
1
PA 27043
1
PA 27044
1
PA 27045
1
PA

Need to split data based on tab space" " for next column and double tab space" " for next row.


Required as table in ssrs reports.










share|improve this question





























    0















    Need to display string data to table using ssrs reports.
    Have data in new_details field as string format



    PO SEQ Country
    65774 1 PE
    27039 1 PA
    27040 1 PA
    27041 1 PA
    27042 1 PA
    27043 1 PA
    27044 1 PA
    27045 1 PA



    need to convert as this data into table. i tried below query but it not worked.



    declare @ModelID VARCHAR(max)

    --make sure to use brackets
    set @ModelID = (select new_details from new_order
    where newid='857647')

    select @ModelID

    DECLARE @p VARCHAR(50)
    select * from dbo.SplitStringtoTable(@ModelID,' ')


    Now getting output as



    Item
    PO
    SEQ
    Country 65774
    1
    PE 27039
    1
    PA 27040
    1
    PA 27041
    1
    PA 27042
    1
    PA 27043
    1
    PA 27044
    1
    PA 27045
    1
    PA

    Need to split data based on tab space" " for next column and double tab space" " for next row.


    Required as table in ssrs reports.










    share|improve this question



























      0












      0








      0








      Need to display string data to table using ssrs reports.
      Have data in new_details field as string format



      PO SEQ Country
      65774 1 PE
      27039 1 PA
      27040 1 PA
      27041 1 PA
      27042 1 PA
      27043 1 PA
      27044 1 PA
      27045 1 PA



      need to convert as this data into table. i tried below query but it not worked.



      declare @ModelID VARCHAR(max)

      --make sure to use brackets
      set @ModelID = (select new_details from new_order
      where newid='857647')

      select @ModelID

      DECLARE @p VARCHAR(50)
      select * from dbo.SplitStringtoTable(@ModelID,' ')


      Now getting output as



      Item
      PO
      SEQ
      Country 65774
      1
      PE 27039
      1
      PA 27040
      1
      PA 27041
      1
      PA 27042
      1
      PA 27043
      1
      PA 27044
      1
      PA 27045
      1
      PA

      Need to split data based on tab space" " for next column and double tab space" " for next row.


      Required as table in ssrs reports.










      share|improve this question
















      Need to display string data to table using ssrs reports.
      Have data in new_details field as string format



      PO SEQ Country
      65774 1 PE
      27039 1 PA
      27040 1 PA
      27041 1 PA
      27042 1 PA
      27043 1 PA
      27044 1 PA
      27045 1 PA



      need to convert as this data into table. i tried below query but it not worked.



      declare @ModelID VARCHAR(max)

      --make sure to use brackets
      set @ModelID = (select new_details from new_order
      where newid='857647')

      select @ModelID

      DECLARE @p VARCHAR(50)
      select * from dbo.SplitStringtoTable(@ModelID,' ')


      Now getting output as



      Item
      PO
      SEQ
      Country 65774
      1
      PE 27039
      1
      PA 27040
      1
      PA 27041
      1
      PA 27042
      1
      PA 27043
      1
      PA 27044
      1
      PA 27045
      1
      PA

      Need to split data based on tab space" " for next column and double tab space" " for next row.


      Required as table in ssrs reports.







      sql reporting-services ssrs-2008 dynamics-crm ssrs-2012






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 28 '18 at 9:05







      Raj

















      asked Nov 27 '18 at 21:11









      RajRaj

      34




      34
























          1 Answer
          1






          active

          oldest

          votes


















          0














          According to your description, it seems that you want to split string into multiple columns, right? If so, I think you could try to use query like below to achieve goal



          DECLARE @Tmp TABLE (Id INT,Name VARCHAR(20)) 
          INSERT @Tmp SELECT 1,'Vidhyasagar,K'
          INSERT @Tmp SELECT 2,'Sathya,S'
          INSERT @Tmp SELECT 3,'Madhu,K'


          --Using PARSENAME

          SELECT Id,
          PARSENAME(REPLACE(Name,',','.'),2) Name,
          PARSENAME(REPLACE(Name,',','.'),1) Surname
          FROM @Tmp


          You could refer to T-SQL Script to Split a column with delimited string into multiple columns for details.



          Zoe






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53508187%2fstring-to-table-passing-two-delimiters-split-in-ssrs-reports%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            According to your description, it seems that you want to split string into multiple columns, right? If so, I think you could try to use query like below to achieve goal



            DECLARE @Tmp TABLE (Id INT,Name VARCHAR(20)) 
            INSERT @Tmp SELECT 1,'Vidhyasagar,K'
            INSERT @Tmp SELECT 2,'Sathya,S'
            INSERT @Tmp SELECT 3,'Madhu,K'


            --Using PARSENAME

            SELECT Id,
            PARSENAME(REPLACE(Name,',','.'),2) Name,
            PARSENAME(REPLACE(Name,',','.'),1) Surname
            FROM @Tmp


            You could refer to T-SQL Script to Split a column with delimited string into multiple columns for details.



            Zoe






            share|improve this answer




























              0














              According to your description, it seems that you want to split string into multiple columns, right? If so, I think you could try to use query like below to achieve goal



              DECLARE @Tmp TABLE (Id INT,Name VARCHAR(20)) 
              INSERT @Tmp SELECT 1,'Vidhyasagar,K'
              INSERT @Tmp SELECT 2,'Sathya,S'
              INSERT @Tmp SELECT 3,'Madhu,K'


              --Using PARSENAME

              SELECT Id,
              PARSENAME(REPLACE(Name,',','.'),2) Name,
              PARSENAME(REPLACE(Name,',','.'),1) Surname
              FROM @Tmp


              You could refer to T-SQL Script to Split a column with delimited string into multiple columns for details.



              Zoe






              share|improve this answer


























                0












                0








                0







                According to your description, it seems that you want to split string into multiple columns, right? If so, I think you could try to use query like below to achieve goal



                DECLARE @Tmp TABLE (Id INT,Name VARCHAR(20)) 
                INSERT @Tmp SELECT 1,'Vidhyasagar,K'
                INSERT @Tmp SELECT 2,'Sathya,S'
                INSERT @Tmp SELECT 3,'Madhu,K'


                --Using PARSENAME

                SELECT Id,
                PARSENAME(REPLACE(Name,',','.'),2) Name,
                PARSENAME(REPLACE(Name,',','.'),1) Surname
                FROM @Tmp


                You could refer to T-SQL Script to Split a column with delimited string into multiple columns for details.



                Zoe






                share|improve this answer













                According to your description, it seems that you want to split string into multiple columns, right? If so, I think you could try to use query like below to achieve goal



                DECLARE @Tmp TABLE (Id INT,Name VARCHAR(20)) 
                INSERT @Tmp SELECT 1,'Vidhyasagar,K'
                INSERT @Tmp SELECT 2,'Sathya,S'
                INSERT @Tmp SELECT 3,'Madhu,K'


                --Using PARSENAME

                SELECT Id,
                PARSENAME(REPLACE(Name,',','.'),2) Name,
                PARSENAME(REPLACE(Name,',','.'),1) Surname
                FROM @Tmp


                You could refer to T-SQL Script to Split a column with delimited string into multiple columns for details.



                Zoe







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 1 at 8:05









                zoe zhizoe zhi

                1193




                1193
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53508187%2fstring-to-table-passing-two-delimiters-split-in-ssrs-reports%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                    Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                    A Topological Invariant for $pi_3(U(n))$