?
Solved

SQL UNION query as recordsource for a report

Posted on 1998-09-01
1
Medium Priority
?
217 Views
Last Modified: 2006-11-17
I have a Union query, not too complex, which I am trying to use as a recordsource for a simple report. The query runs fine from the database window. When I specify it as the recordsource for the report, and try to run the report, I get the error message "Jet database engine could not execute the SQL statement because it contains a field that has an invalid datatype". The help file behind this message doesn't help me. Not sure how to debug this problem. All of the fields in the query have fields on the report. Each of the two queries that make up the UNION query work fine as the recordsource for the report! SOmething weird with the report not liking the UNION.
0
Comment
Question by:rjbryla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
kulikuli earned 300 total points
ID: 1960935
Most probably there is a difference in datatypes between tables in the first and the second part of the queries that make up the union query. Check this first.
If you cannot find it this way then try removing a few fields(in both parts of the union) and try again running the report. You will find out which field causes the error. Then you are able to format it as you desire using the format function.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question