Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2007
    Posts
    127

    Unanswered: IIf Statement with a LIKE

    Can't get my IIf statement in Access query to compile correctly.

    Don't know if i'm adding the "like" statement correctly?

    Many thanks,


    IIf([Consultant Specialty]= like "*anaes*","Pain Management",[Consultant Specialty])

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    You use LIKE instead of =, not in addition

  3. #3
    Join Date
    Oct 2007
    Posts
    127
    Quote Originally Posted by pootle flump
    You use LIKE instead of =, not in addition
    you are star!

    thanks mate

  4. #4
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Re

    Don't think you can do a = and like in 1 statement

    Would rater use iif(instr(text,text2)>0 ,True,False)

  5. #5
    Join Date
    Oct 2007
    Posts
    127
    it works perfectly

    as this is a update query, is it possible to add this query to a make table query... for example -

    Make table query-
    Consultant Specialty: ([KORNERNAME])

    Update query-
    IIf([Consultant Specialty]="Oral Surgery","Maxillofacial Surgery"[Consultant Specialty]))

    can i put the update query into the same make table query, if so how?

    thanks in advance

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ok - just to back up a bit - are you renaming multiple specialties? And is it possible that there might be changes in future to these renames (perhaps some new ones added)?

Posting Permissions

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