Results 1 to 4 of 4
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038

    Query as source for Crosstab Query

    Experts:



    I have QUERY_1 which has the following (example) fields: [FIELD_1], [FIELD_2], [FIELD_3]

    QUERY_1 outputs, for example, the following data:
    FIELD_1 **** FIELD_2 ***** FIELD_3
    ABC ***** Section_1 ***** 10
    ABC ***** Section_2 ***** 20
    ABC ***** Section_3 ***** 30

    Now, I use QUERY_1 as my source for a crosstab query:
    - FIELD_1 as "Row Heading"
    - FIELD_2 as "Column Heading"
    - FIELD_3 as "Value" (expression"

    My crosstab query output looks as follows:
    FIELD_1 **** Section_1 ***** Section_2 ***** Section_3
    ABC *****10 ***** 20 ***** 30

    ... this works great!

    However, in the event I don't have value "Section_3" in QUERY_1, I now get an error in my crosstab query. Errors reads: "Database engine does not recognize QUERY_1.[Section_3] as a valid field name or expression.

    My question: How should I modify my cross tab query so that I will always get the three columns/fields (Section_1, Section_2, Section_3) even if any of these 3 values (i.e., Section_3) did NOT exist as a value in my input query QUERY_1?

    I hope this makes sense.

    Thank you,
    EEH

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Perfect... thank you, Paul.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 12-19-2019, 12:23 PM
  2. Replies: 8
    Last Post: 05-11-2017, 07:54 AM
  3. Replies: 2
    Last Post: 08-16-2013, 01:36 AM
  4. CrossTab Queries data source to Excel?
    By Shakenaw in forum Queries
    Replies: 0
    Last Post: 07-05-2011, 08:26 AM
  5. Replies: 1
    Last Post: 07-30-2010, 10:28 AM

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