Create a new table with the results of a query that uses multiples criterias from 2 different tables

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
Guys

I have one table that contains a memo field (tblWithMemoField)
The second table has some keywords (tblWithKeyWords)

What I want to do is a query that can generate a table using the field fldCriteria(tblWithKeyWords) to find the records from the tblWithMemoField on field (fldMemo).
There is no relationship between the tables.


tblWithMemoField
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Remarks[/TD]
[/TR]
[TR]
[TD]CompanyName[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]fldMemo[/TD]
[TD]This field will be the target - Memo[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]







tblWithKeyWords
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]idKeyWord[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]fldCriteria[/TD]
[TD]My criteria - Text field[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]






Would be something literally like below - Of course the statement below doesn't work.

Code:
[COLOR=#008000][FONT='inherit'][B]SELECT [/B][/FONT][/COLOR][COLOR=#333333][FONT='inherit']CompanyName [/FONT][/COLOR][COLOR=#008000][B]FROM[/B][/COLOR] tblWithMemoField [COLOR=#008000][FONT='inherit'][B]WHERE[/B][/FONT][/COLOR][COLOR=#333333][FONT='inherit']((([/FONT][/COLOR][COLOR=#333333][FONT='inherit']fldMemo[/FONT][/COLOR][COLOR=#333333][FONT='inherit'])[/FONT][/COLOR][COLOR=#008000][FONT='inherit'][B]LIKE[/B][/FONT][/COLOR][COLOR=#19177C][FONT='inherit']"*"[/FONT][/COLOR][COLOR=#666666][FONT='inherit']+[/FONT][/COLOR][COLOR=#333333][FONT='inherit'][[/FONT][/COLOR][COLOR=#333333][FONT='inherit']tblWithKeyWords[/FONT][/COLOR][COLOR=#333333][FONT='inherit']][/FONT][/COLOR][COLOR=#666666][FONT='inherit']![/FONT][/COLOR][COLOR=#333333][FONT='inherit'][[/FONT][/COLOR][COLOR=#333333][FONT='inherit']fldCriteria[/FONT][/COLOR][COLOR=#333333][FONT='inherit']][/FONT][/COLOR][COLOR=#666666][FONT='inherit']+[/FONT][/COLOR][COLOR=#19177C][FONT='inherit']"*"[/FONT][/COLOR][COLOR=#333333][FONT='inherit']));[/FONT][/COLOR]

How can I do it?

Luthius
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top