Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am trying to set up a fairly co

Status
Not open for further replies.

lhite

Technical User
Aug 1, 2002
133
US

I am trying to set up a fairly complicated query. The first query pulls patient data from an ODBC database. I then have four more queries that use this query as their data source, applying more criteria. These four queries all return the same fields for their respective populations. I am trying to set up a Union Query to get all the results in one place. When I try to join the queries together with a Union Query I get an error message: "ODBC--Call Failed". I have the ODBC Timeout set to 0 for all the queries. If I change the source queries to Make-Table Queries and create tables from the query data, then change the data sources of the Union Query to the newly-made tables, the Union Query works fine (however I prefer not to have to do this every time I want to run the query again).

Is it not possible to create a Union Query based on other queries of an ODBC data source? Am I doing something wrong?

-Larry
 
This should be possible, can you confirm that the data types of fields in both the ODBC linked table and the local table are compatible(they must be compatible for the union to work), maybe by trying a simple query on a few fields and building from there

Andy
 
All the queries are based on the same table, so their data types are the same. As I mentioned, if I use the queries to make tables from each one, the union then works, however as I will need to run this union fairly often I don't want to have to create the tables each time.

-Larry
 
Since I forgot to fill in the Subject field and received the beginning of the first sentence, I'm going to repost this with an appropriate section. Please direct all followups to that post. Thanks,

-Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top