By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Query of two tables

P: n/a
Hi,
I have to create a query which would be composed of two tables, which have
a common field ('FileName'). Now, the query have to be composed of the
record who suddisfy to the following condition:
table1.FileName=table2.FileName. So I would to have a query composed of the
records where the upper condition is suddisfied.
How can I do it? I know that I have to write some SQL condition, but which
and where do I have to put it in?
Thanks
Bernd
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Bernd Smits" <b.*****@tiscali.it> wrote in
news:42**********************@news.tiscali.it:
Hi,
I have to create a query which would be composed of two
tables, which have a common field ('FileName'). Now, the query
have to be composed of the record who suddisfy to the
following condition: table1.FileName=table2.FileName. So I
would to have a query composed of the records where the upper
condition is suddisfied. How can I do it? I know that I have
to write some SQL condition, but which and where do I have to
put it in? Thanks
Bernd

This os so easy. Use the query builder.

Go to the queries tab of the database window. Click the "Create
Button", select design mode.
Pick your two tables from the dialog. Now click on the field in
the first table (filename) and drag to the field in the second
table.
Doubleclick on each field you want in the query.

save, and run. You can see the SQL the builder has created by
opening the query in design mode and choosing SQL view.


--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #2

P: n/a
Hi,

If you are writing an SQL statement:

select *
from table1,table2
where table1.filename = table2.filename

(instead of *. which will slelect all the fields, you can specify the
fields you want)

If you are using the query designer, then see the following topics in
Access Help

Join multiple tables and queries in a query
Enter criteria in a query or advanced filter to retrieve certain
records

HTH

Sunil Korah

"Bernd Smits" <b.*****@tiscali.it> wrote in message news:<42**********************@news.tiscali.it>...
Hi,
I have to create a query which would be composed of two tables, which have
a common field ('FileName'). Now, the query have to be composed of the
record who suddisfy to the following condition:
table1.FileName=table2.FileName. So I would to have a query composed of the
records where the upper condition is suddisfied.
How can I do it? I know that I have to write some SQL condition, but which
and where do I have to put it in?
Thanks
Bernd

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.