Query Reading From Multiple Tables through ODBC Connection

fadilrexhepi

Registered User.
Local time
Today, 14:35
Joined
Feb 10, 2015
Messages
16
Hi,

I am working on an MSACCESS database that reads data from SQL Server through ODBC Connection.
I have multiple tables that I have linked in and created Queries that read the data and created Make Table query.
However, I am asking if there's a way to bring the data through a query that doesn't need the linked tables. Is there a way to bring different fields from different tables into one query without needing to import all the tables, since the tables have many fields that I don't need.

For example in MS Excel, I am able to do that, a query that will bring external data from SQL Server from different tables and only brings the fields that I need for my report.

Regards,
Fadil
 
Did you confuse yourself? A linked table does not "bring different fields" over - it is just a method to specify what is available, until you call on the table or via a query. You can make a query extracting fields from linked tables. Do not confuse "import" with "link". Two entirely different things.
 
Hi spikepl,

Thank you for your reply. With my knowledge of msaccess I might confuse myself and confuse you also :-).

What I currently have is, I have linked tables (not imported) through ODBC connection.
Now, for each linked table I have created queries to call only the fields I need, then created union query, worked on the relationship of the fields and derived to the result.
So, in this case, I haven't done anything wrong, I haven't taken a longer path, have I? Please advise

For example, in MSEXCEL below is how I derive to the information:
SELECT PR01MG00.PR01001, PR01MG00.PR01009, PR02MG00.PR02001, PR02MG00.PR02002, PR02MG00.PR02003, PR02MG00.PR02006, PR02MG00.PR02008, PR02MG00.PR02043, SC07MG00.SC07001, SC07MG00.SC07002, SC07MG00.SC07003, SC07MG00.SC07004, SC07MG00.SC07005, SC07MG00.SC07007, SC07MG00.SC07056

FROM dbo.PR01MG00 PR01MG00, dbo.PR02MG00 PR02MG00, dbo.SC07MG00 SC07MG00

WHERE PR01MG00.PR01001 = PR02MG00.PR02001 AND PR02MG00.PR02043 = SC07MG00.SC07007 AND ((PR01MG00.PR01001=?)) AND
SC07MG00.SC07001='01' AND PR02MG00.PR02043<>''


So, in MSACCESS I need to link the tables (for example dbo.PR01MG00, dbo.PR02MG00, SC07MG00) and then create a query for the fields I need to read from these tables, is that so?

Regards,
Fadil
 

Users who are viewing this thread

Back
Top Bottom