Results 1 to 3 of 3
  1. #1
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169

    Union Query Question

    I am using the attached Union Query which works fine but I need to tweak it a bit to add an additional column of data.
    Code:
    select 1 as temp,first([Order]) as Sequence,Question,"" as Response,"" as ResponseCriteria from table2 
    group by Question
    UNION select 2 as temp, [Order],"",Response,ResponseCriteria from table2
    ORDER BY [Sequence], temp;
    I have Table2 as shown and when the code is run, it produces Output2 as shown. I am trying to figure out how to print the QuestionCriteria in a column next to the Question as shown in the DesiredOutput.



    Thanks for any help!

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Jim,

    Good to talk to you again. Glad you got your other issue fixed. As far as this is concerned, I'm not sure you can do it really. Others have more experience than I do with this I'm sure, but you're already manipulating the data abnormally in the UNION. I see you're using Allen Browne's method.

    What happens when you include the criteria field both parts of the UNION? Have you tried all combinations of "" and field when adding it in? What are the results? Based on what you've already written, I would think that using "[field]" in the first part of the UNION and "" in the second part would get you close, if not what you want.

  3. #3
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169
    Hey Adam,

    Thanks for all your previous help...database is working pretty well.

    I haven't really tried much yet...I am not anticipating too much success as you implied, but thought I would throw it out here for consideration.

    I will try to work on it some this afternoon to see what might work.

    Thanks much.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Union Query (choosing between two fields)
    By naveehgreen in forum Programming
    Replies: 1
    Last Post: 06-17-2010, 03:24 PM
  2. union query with a calculated field
    By grad2009 in forum Queries
    Replies: 9
    Last Post: 03-31-2010, 04:50 PM
  3. Need help with a Union Query
    By jdowdy in forum Access
    Replies: 1
    Last Post: 10-13-2009, 05:24 PM
  4. Create table out of union query
    By DKruse1969 in forum Queries
    Replies: 2
    Last Post: 08-28-2009, 09:55 AM
  5. Replies: 0
    Last Post: 12-28-2008, 01:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums