Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    118

    Red face Unanswered: cant get this boolean to work!!

    Hi,

    I'm trying to do a very simple query and one of the fields neest to be changed to "open" or "closed" if it starts with 'P'.

    So I am writing this expression:

    list: if(DwgType.Table = 'p*',"Open","Closed")

    its returning an "undifined function "if" in expression" error.

    I'm sure this is something really silly, but could someone give me a hand please?

    Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: cant get this boolean to work!!

    Originally posted by YevSnow
    list: if(DwgType.Table = 'p*',"Open","Closed")
    This is SQL???

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    It smells like MS-Access (or more accurately, VBA) to me.

    -PatP

  4. #4
    Join Date
    Mar 2004
    Location
    Karachi, Pakistan
    Posts
    3
    Hello YevSnow,
    I dont know which tool you are using but i think you should try the following

    ORIGINAL CODE:
    list: if(DwgType.Table = 'p*',"Open","Closed")

    CHANGED CODE: TRY 1

    list: if(DwgType.Table LIKE 'p%',"Open","Closed")


    I would like to know which tools do you use?
    if this is Excel then i think the above code should work.
    otherwise tell us the tools try and ask for our help.

  5. #5
    Join Date
    Mar 2004
    Posts
    118
    It's access yea, ops did i post on the wrong forum?

    I tried the % it likes it even less. It seems to be a problem with the synthax... I'll repost this on the access vba forum.

    Thanks everyone!

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    For MS-Access you want iif() instead of if(). I guess somebody had keyboard-stutter... Actually, they wanted to distinguish between a VBA IF statement and the "Immediate If" function, but that was a VERY long time ago!

    -PatP

Posting Permissions

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