• Concatenation Query (A2K)

    Author
    Topic
    #447510

    I’m trying to merge some results from a web survey output using a query.
    Each survey has 13 questions. In the output there are some extra rows because of the way the survey is.
    If they answer a “Select all that apply” type question, you get a row for each answer. There are 4 such questions(Application, Frequency, Revenue,Barriers)
    What I’m trying to do is merge them into a single line separated by a semicolon so I end up with 13 rows for each survey returned.
    I found some code from Dev Ashish that almost works. It takes the results from all the records and merges all them by question the type, not by the individual survey’s which is what I need.
    The attachment makes it clearer. tblTestImport are the records, qryConcat is the query using the code and WhatQueryResultsShouldBe is how I would like the query to work.
    I have struggled for 3 hours now trying to modify the code and need some assistance.
    Thanks,
    Scott

    Viewing 0 reply threads
    Author
    Replies
    • #1091598

      See the attached version. It uses a different function based on the Concat function from post 301,393 (I had to rename it since Concat is the name of the database – you cannot have a procedure or function with the same name as the project name).

      • #1091604

        Hans,
        I can’t thank you enough.
        That worked perfectly.

        Scott

        • #1091607

          In fact, I made a small mistake in the date/time format. blush
          Here is a corrected version.

    Viewing 0 reply threads
    Reply To: Concatenation Query (A2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: