Bringing in a query to excel via MSQuery giving me bogus response

  • Thread starter Thread starter theseandavis
  • Start date Start date
T

theseandavis

Hey guys,

Im trying to bring in data from access into my excel file here. Its a
union query that runs fine in access and returns about 12000 results,
merging together two seperate tables. When I try and bring it into
excel via MS Query, it tells me there are too few returned results
(less than 1). What gives? I can run this thing till the cows come home
with no problems in access.
 
I have discovered that this is a limitation of excel - all union
queries must be performed within excel, or the data must be made into
table form before importing.

See the following link

http://66.102.7.104/search?q=cache:...ion+query+with+excel&hl=en&gl=ca&ct=clnk&cd=9

.... it will most likely not work, so for future generation's benefit,
here is the text from the thread:

*************************************************
I have crate a union query in Ms Access XP to combine 2 tables Customer
&
Vendor.

Below is how the query looks like

SELECT strCustomerID as strID, strCompanyName, "Customer" as strType
FROM tblCustomer
UNION SELECT strVendorID as strID, strCompanyName, "Vendor" as strType
FROM tblVendor;

It can run properly in Ms Access but when I try to import the data from
Ms
Access
using Ms Excel's Import External Data | New Database Query, MS Excel
complaints
Too few parameters. Expected 2.

Anyone knows what when wrong?


Thank You

xxxxxx Suggestions that did not work xxxxxxx

I think I found out what's wrong.

The cause of the problem lies in Ms Excel. It cannot support a query
with
calculated/derived field.

However if you do it using Ms Query from within Ms Excel you can do any

union query with any number calculated fields.
***********************************************************
-S
 
Back
Top