Results 1 to 3 of 3
  1. #1
    Falcon37 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2021
    Posts
    2

    The number of columns in two selected table or queries of a union query do not match

    Hello everyone. I have an database error:
    "The number of columns in two selected tables or queries of a union query do not match"
    I used a union query of 4 queries (exhibit a) . I pulled one query "total equal total and return tax diff into a table in design view and it shows fields (exhibit b). However, (exhibit c) when i pulled all four queries of the union query into a new query, two of the four queries don't show any fields which is why i am getting an error. No idea why this is happening. Discussed with a few co-workers and they were baffled also tried googling for answer and after 5 hours got no where. Attached are visual screenshots


    Access error Exhibit A-C.zipAccess error Exhibit A-C.zipAccess error Exhibit A-C.zip

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,911
    Unions queries must have the same number of fields AND the same type?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    The first two datasets don't have same number of fields. I don't see how UNION with SELECT * could work at all.

    You could provide db for direct analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 02-26-2021, 05:58 PM
  2. Replies: 1
    Last Post: 08-06-2020, 11:50 AM
  3. Replies: 11
    Last Post: 12-26-2018, 06:07 PM
  4. Perform a Union All Query For Two Columns in the Same Table
    By DigitalAdrenaline in forum Queries
    Replies: 14
    Last Post: 08-19-2018, 05:39 PM
  5. Replies: 5
    Last Post: 10-12-2017, 12:12 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