PDA

View Full Version : Solved: Searching for a text string in an Access Database



AndyClay
03-03-2005, 09:28 AM
I am using Query Design to set up a new query.

I have one field that contains a surname. I need a formula that returns TRUE (or a value) when the surname contains "DECEASED" and FALSE (or an error) when the surname doesn't.

The Worksheet function SEARCH doesn't seem to work. Any ideas?

Norie
03-03-2005, 12:42 PM
Take a look at the Instr function.


Deceased: IIf(InStr([SurName],"DECEASED")<>0,"True","False")

AndyClay
03-04-2005, 09:00 AM
This works perfectly. Thanks very much.