• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1073
  • Last Modified:

Microsoft Access 2010 Union Query Error Message

I have a union query that combines the fields from 15 other queries. I can run the union query and it works perfectly fine but when I try to use that union query in a report I receive the following error: "The number of columns in the two selected tables or queries of a union query do not match".

Like I said, I can run the union query with no problems it just when I try to use that query as a record source in a report that I get the error.
0
CamposInc
Asked:
CamposInc
  • 4
  • 2
1 Solution
 
hnasrCommented:
Option 1:
Reduce the number of queries and check.
If it works add a new query and recheck.
Repeat previous step and report when the error starts to show.

Option 2:
Upload the database, with reduced number of data records leaving only the necessary objects to produce the problem.
0
 
CamposIncAuthor Commented:
Thanks for the quick reply.

I tried removing all but two of the queries in the union query and it was still allowing me to run the query but when I use that query in the report it gives me the same error.

I'm attaching a zipped copy of the database with only the tables/queries/reports needed to reproduce the error.

Thanks for your help!
Temp.zip
0
 
hnasrCommented:
Please comment on these queries, because they have different number of fields from the rest of queries which have have 9 fields.

qryProjectReport-RevenueAllocation01-Bid   242
qryProjectReport-RevenueAllocation01-RSBucket99          15
qryProjectReport-RevenueAllocation02-ProjectCosts        3
qryProjectReport-RevenueAllocation03-OutsourcedVendors   3
qryProjectReport-RevenueAllocation04-EquipmentServices   3
qryProjectReport-RevenueAllocation05-Expenses            3
qryProjectReport-RevenueAllocation99-LastFacilityDate01  3
qryProjectReport-RevenueAllocation99-LastFacilityDate02  4
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
CamposIncAuthor Commented:
qryProjectReport-RevenueAllocation01-Bid
This is my starting point. This contains the projects that all the other queries are based off of.

qryProjectReport-RevenueAllocation01-RSBucket99
This is my final query. This is a combination of the qryProjectReport-RevenueAllocation01-Bid query and the qryProjectReport-RevenueAllocation01-RSBucket98 query.

qryProjectReport-RevenueAllocation02-ProjectCosts
qryProjectReport-RevenueAllocation03-OutsourcedVendors
qryProjectReport-RevenueAllocation04-EquipmentServices
qryProjectReport-RevenueAllocation05-Expenses
These four queries determine if there are any other associated costs for each of the projects in qryProjectReport-RevenueAllocation01-Bid.

qryProjectReport-RevenueAllocation99-LastFacilityDate01
qryProjectReport-RevenueAllocation99-LastFacilityDate02
These two queries determine the "RevenueMoveDate" for SOME of the projects.

The only queries that are in the union query are the queries with nine fields in them.
0
 
CamposIncAuthor Commented:
I have not figured out why this is happening, however, I have found a workaround for this.

I created a query that takes the data in qryProjectReport-RevenueAllocation01-RSBucket99
 (my final query that I could not use in my report) and made a "make table" query.

This creates a temporary table that I can then use in my report.
0
 
CamposIncAuthor Commented:
Found a work around that accomplishes the same thing as I wanted.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now