PC Review


Reply
Thread Tools Rate Thread

display criteria as a field in returned data

 
 
Masoud
Guest
Posts: n/a
 
      5th Apr 2010
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.

 
Reply With Quote
 
 
 
 
Daryl S
Guest
Posts: n/a
 
      5th Apr 2010
Masoud -

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

--
Daryl S


"Masoud" wrote:

> 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.
>

 
Reply With Quote
 
Masoud
Guest
Posts: n/a
 
      6th Apr 2010
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" wrote:

> Masoud wrote:
> >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]
>
> --
> Marsh
> MVP [MS Access]
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display Table Field names AND Field Definitions in a Report ? (ditto for query fields & criteria) Will Microsoft Access 1 29th Aug 2007 01:14 PM
Criteria to be displayed in returned field =?Utf-8?B?UGF1bCBEZW5uaXM=?= Microsoft Access Queries 3 3rd Nov 2006 08:17 AM
Data type mismatch in criteria expression error returned... Rashar Sharro via AccessMonster.com Microsoft Access Queries 1 29th Apr 2005 09:45 PM
Data type mismatch in criteria expression error returned... Rashar Sharro via AccessMonster.com Microsoft Access Queries 3 28th Apr 2005 08:49 PM
[Field Name] returned as data - how? Martin Lacoste Microsoft Access Queries 4 4th Jul 2004 08:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.