Conditional Queries Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm new to Access.

I have a function in excel that I want to do in access below:
=IF(ISNUMBER(SEARCH("v",A2)),"OK", "Not OK")

It's called "Check if part of a cell matches specific text".

Any help would greatly be appreciated. Super thanks!
 
Oh thank you, thank you, thank you....

An added complication...

What I really want it to do is to look for "v", but if it doesn't find "v",
look for "s", if it doesn't find "s", look for "t" and so on....

Do I need to nest if statements? Or is there an easier way to do it?

KARL DEWEY said:
Try this --
IIF(Instr([YourField], "v") >0,"OK", "Not OK")

--
KARL DEWEY
Build a little - Test a little


DyingIsis said:
I'm new to Access.

I have a function in excel that I want to do in access below:
=IF(ISNUMBER(SEARCH("v",A2)),"OK", "Not OK")

It's called "Check if part of a cell matches specific text".

Any help would greatly be appreciated. Super thanks!
 
What I really want it to do is to look for "v", but if it doesn't find "v",
look for "s", if it doesn't find "s", look for "t" and so on....

Do I need to nest if statements? Or is there an easier way to do it?

Probably, but we don't have a clear idea what your table contains or what
you're trying to accomplish. What's in the field? What do you want to happen
when the field contains one of these letters? Would it help to search for all
records where the field contains any one of vstuwx? If so a Query with a
criterion on the field

LIKE "*[vstuwx]*"

will search for all those records with no code or if's at all...

John W. Vinson [MVP]
 
Do you do different things if "v" is present, than if "s" is present. If
not, John Vinson's criteria can be adapted into your expression.

Field: IIF([SomeField] Like "*[stuvwx]*","OK","Not OK")

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

John W. Vinson said:
What I really want it to do is to look for "v", but if it doesn't find
"v",
look for "s", if it doesn't find "s", look for "t" and so on....

Do I need to nest if statements? Or is there an easier way to do it?

Probably, but we don't have a clear idea what your table contains or what
you're trying to accomplish. What's in the field? What do you want to
happen
when the field contains one of these letters? Would it help to search for
all
records where the field contains any one of vstuwx? If so a Query with a
criterion on the field

LIKE "*[vstuwx]*"

will search for all those records with no code or if's at all...

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top