Results 1 to 3 of 3

Thread: multiple ifs'

  1. #1
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259

    Unanswered: multiple ifs'

    in my select query, i wanna create a new field, Expr1:
    it should say, "Urgent" if the string in another field says "(1) Urgent Priority", "Normal" if the other field says "(2) Normal Priority" and "Low" if it says "(3) Low Priority".

    How do i do this? i know iif takes only a true and false, and choose() takes integer values.
    Help

  2. #2
    Join Date
    Dec 2003
    Location
    Toronto, Ont. Canada
    Posts
    238

    Re: multiple ifs'

    Originally posted by Jerrie
    in my select query, i wanna create a new field, Expr1:
    it should say, "Urgent" if the string in another field says "(1) Urgent Priority", "Normal" if the other field says "(2) Normal Priority" and "Low" if it says "(3) Low Priority".

    How do i do this? i know iif takes only a true and false, and choose() takes integer values.
    Help
    Try.... (after you change [OtherField] to your field name, of course...)

    Expr1: IIf([OtherField] Like "(1)*", "Urgent", IIf([OtherField] Like "(2)*", "Normal", "Low"))

    HTH

  3. #3
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259
    Actually, i decided to go with a module on this one; wrote a function named multipleifs(priority As String) As string and then accessed that function in my query;

    I will try your method, and thx for the help

Posting Permissions

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