Exact key word search (1 Viewer)

ccondran08

Registered User.
Local time
Today, 21:50
Joined
Feb 27, 2014
Messages
58
Hi, i'm looking for a solution for a problem where i want to put in a formula in a query field that will search for an exact word/s within a field in the same query. For example ;

Tag: IIf(([description] Like "tag"),1,"")

However, words such as 'stage' and 'voltage' are appearing in the results. Any help would be muchly appreciated.

:banghead:
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:50
Joined
May 7, 2009
Messages
19,249
use equality sign (=)

Tag: Abs([Description] = "tag")
 

plog

Banishment Pending
Local time
Today, 08:50
Joined
May 11, 2011
Messages
11,676
You need to be more specific in what you want--both in your explanation to us and your coding. Tell me which of these should resolve to 1 for Tag:

Tag
tag
This tag is broken
The stage is over there
I found the tag.
Don't replace anything--tag included.

Which of those do you want?
 

ccondran08

Registered User.
Local time
Today, 21:50
Joined
Feb 27, 2014
Messages
58
Sorry, i'm looking for the word 'tag' only. There is a field called 'description' and has up to 50 words in the field. I am looking for find any records that have the word 'tag' in the description field.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 23:50
Joined
Jan 20, 2009
Messages
12,863
You need to search for several possibilities.

Like "* tag" OR Like "tag *" OR = "* tag *"

If you are including punctuation

Like "* tag[.,!;:]"
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:50
Joined
Feb 19, 2013
Messages
16,713
to find the word 'tag' you need to search on many options which is what plog is alluding to, including are you needing to specifying the case?

for example you could just use

like '* tag *'

but what if it is the first or last word (there will be no space either before or after) or it is followed or proceeded by a full stop, comma, question mark, bracket etc.?

Suggest you google 'regular expressions' or 'regex' which will show you why your question is not clear enough to provide a proper answer - with the vagueness of the question it is all that can be suggested as a solution.

Also investigate the use of access wildcards which is effectively a simple form of regex.
 

plog

Banishment Pending
Local time
Today, 08:50
Joined
May 11, 2011
Messages
11,676
Sorry, i'm looking for the word 'tag' only.

In that case you simply need:

Tag: IIf([description]="tag",1)
 

jdraw

Super Moderator
Staff member
Local time
Today, 09:50
Joined
Jan 23, 2006
Messages
15,409
ccondran80,
Sorry, i'm looking for the word 'tag' only. There is a field called 'description' and has up to 50 words in the field. I am looking for find any records that have the word 'tag' in the description field.
For clarity:
Do you have a series of separate terms in the description field?
Could you show us an example of what is in the description field?
 

Users who are viewing this thread

Top Bottom