Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are access query results different in Excel DannyD Excel Discussion (Misc queries) 0 July 29th 07 04:54 AM
Access query results to Excel piano banger Excel Discussion (Misc queries) 4 December 8th 06 09:32 AM
Applying functions to web query results ExcelTina Excel Discussion (Misc queries) 0 November 29th 06 10:36 PM
Confine results of web query to one cell JayPatterson Excel Discussion (Misc queries) 0 December 24th 04 03:21 PM
Web Query Sleep for until results come Sunil_Modi Excel Worksheet Functions 0 November 19th 04 04:29 PM


All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"