Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Concatenation Query (A2K)

    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
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Concatenation Query (A2K)

    See the attached version. It uses a different function based on the Concat function from <post:=301,393>post 301,393</post:> (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).
    Attached Files Attached Files

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concatenation Query (A2K)

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


    Scott

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Concatenation Query (A2K)

    In fact, I made a small mistake in the date/time format. <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    Here is a corrected version.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •