query help

gripper

Board Regular
Joined
Oct 29, 2002
Messages
176
I have an Access DB with a table Keyword.

I have a query set up with field "Keyword" in the first column and "ID" and the second. What I need is help with the criteria syntax.

This table has many records and I am trying to see if current strings are present in the Keyword column.

I wrote the following

Like '%vehic%' or '%motorc%' or '%boat%

The keyword column usually has 3-5 word phrases and I am seeking any record that has Vehicle
Motorcycle or
Boat
anywhere in the cell

I know the words are there but I am not getting anything back. So I obviously have the syntax wrong.

Any help would be appreciated.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
It would help if you would post your query so we can see what you have tried.

You could have something along this:

SELECT * from MyTable
WHERE
(KeyWord Like "*" & "vehi" & "*" ) OR
(KeyWord Like "*" & "motorc" & "*") OR
(KeyWord Like "*" & "boat" & "*")


Good luck
 
Upvote 0
Your right I would be better to post the SQL.

Here it is

SELECT Keyword.Keyword, Keyword.ID, Keyword.File_Name
FROM Keyword
WHERE (((Keyword.Keyword) Like '%vehic%' Or (Keyword.Keyword)='%motorc%' Or (Keyword.Keyword)='%boat%'));
 
Upvote 0
Jackd gave you what you need, you just need to change your WHERE clause to use the methodology he showed you how to use:
Code:
SELECT Keyword.Keyword, Keyword.ID, Keyword.File_Name
FROM Keyword
WHERE (((Keyword.Keyword) Like "*" & "vehic" & "*" Or (Keyword.Keyword) Like "*" & "motorc" & "*" Or (Keyword.Keyword) Like "*" & "boat" & "*"));
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,794
Members
452,943
Latest member
Newbie4296

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