display criteria as a field in returned data

M

Masoud

Hello,


I have two table, table1 contain 2 fields ([filename], [filepath])

Table2 contain 1 field ([keyword])

Now I want to make a simple query,from table 1 and [keyword] field from
table2 as a criteria of [filename] for this query, also criteria as a new
field returned by this query. I mean query contain 3 fields [filename],
[filepath], criteria of filename([keyword])

Thanks in advanced.
 
D

Daryl S

Masoud -

SELECT filename, filepath, keyword
FROM Table1 INNER JOIN Table2 on Table1.filename = Table2.keyword;
 
M

Masoud

thank you very much, it works, i wanted not excatly the same value so i used:

SELECT table1.filename, table1.filepath, table2.keyword
FROM table1, table2
WHERE (((table1.filename) Like "*" & [Table2]![keyword] & "*"));
and works now.

Marshall Barton said:
Masoud said:
I have two table, table1 contain 2 fields ([filename], [filepath])

Table2 contain 1 field ([keyword])

Now I want to make a simple query,from table 1 and [keyword] field from
table2 as a criteria of [filename] for this query, also criteria as a new
field returned by this query. I mean query contain 3 fields [filename],
[filepath], criteria of filename([keyword])

You can get all combinations of file stuff and keywords by
using:

SELECT [filename], [filepath], [keyword]
FROM table1, table2

but I don't understand how you want to use keyword as a
filename criteria. If you want to find filrnames that are
the same as a keyword, then use:

WHERE [filename] = [keyword]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top