Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Query Results
This may be a question that needs to be addressed in an Access group
but here it goes. I have 2 tables (Client & Group) Some of the records in the Client table are also part of a group which are coded as such in the Group table. My problem is when I try to pull in data from both tables in Access with MS Query (To MS Excel) it only pulls in data if the records are part of a group. I am not filtering the data so I am not sure why it is not pulling in the data. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Query Results
Michael
It sounds like a problem with the SQL statement. Go to the VBE (alt-F11) and in the immediate window (Cntl-G) look at the SQL string. Type something like this ?Sheet1.QueryTables(1).CommandText That will print the SQL. If you see INNER JOIN in your SQL, then you've found the problem. An inner join will only pull records if the fields match both tables. If you want all the records from the first table and only those that match from the second table, then you want a LEFT JOIN. There is also a RIGHT JOIN. If that turns out to be the problem, the way that would fix it is to go into Access and set up a query that gives the results I want. Then look at the SQL for that query. You can then put that in your Excel querytable via the immediate window: Sheet1.QueryTables(1).CommandText = "SELECT... <paste the sql here" You can also edit your External Data in MSQuery and paste the SQL into its SQL View. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Michael Burkett" wrote in message m... This may be a question that needs to be addressed in an Access group but here it goes. I have 2 tables (Client & Group) Some of the records in the Client table are also part of a group which are coded as such in the Group table. My problem is when I try to pull in data from both tables in Access with MS Query (To MS Excel) it only pulls in data if the records are part of a group. I am not filtering the data so I am not sure why it is not pulling in the data. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why are access query results different in Excel | Excel Discussion (Misc queries) | |||
Access query results to Excel | Excel Discussion (Misc queries) | |||
Applying functions to web query results | Excel Discussion (Misc queries) | |||
Confine results of web query to one cell | Excel Discussion (Misc queries) | |||
Web Query Sleep for until results come | Excel Worksheet Functions |