Consulting

Results 1 to 3 of 3

Thread: Solved: Searching for a text string in an Access Database

  1. #1
    VBAX Newbie
    Joined
    Jul 2004
    Posts
    2
    Location

    Question Solved: Searching for a text string in an Access Database

    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?
    Last edited by AndyClay; 03-03-2005 at 09:30 AM. Reason: Improved Title

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Take a look at the Instr function.
    Deceased: IIf(InStr([SurName],"DECEASED")<>0,"True","False")

  3. #3
    VBAX Newbie
    Joined
    Jul 2004
    Posts
    2
    Location
    This works perfectly. Thanks very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •