Exact key word search

ccondran08

Registered User.
Local time
Today, 16:27
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:
 
use equality sign (=)

Tag: Abs([Description] = "tag")
 
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?
 
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.
 
You need to search for several possibilities.

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

If you are including punctuation

Like "* tag[.,!;:]"
 
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.
 
Sorry, i'm looking for the word 'tag' only.

In that case you simply need:

Tag: IIf([description]="tag",1)
 
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

Back
Top Bottom