Solved

SQL UNION query as recordsource for a report

Posted on 1998-09-01
1
206 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
1 Comment
 
LVL 5

Accepted Solution

by:
kulikuli earned 100 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now