Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IIF statement in query (2003)

    I have a field called FAContracts. I want to create a calculation using that field according toanother field called Group Market Status. When Group Market Status = 100, I want FAContracts else 0. If Group Market Status = 2, I want Facontracts else 0. This is probably Access 101 but I haven't been working with Access for a while. Here is what I am trying
    FaContracts2: IIf([BlueChoice.Group market Status]=100,[FaContracts],0), IIf([BlueChoice.Group market Status]=2,[FAContracts],0)
    I know my syntax is wrong. I tried putting an OR but it didn't work. I got negative ones etc. Any help would be appreciated. Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: IIF statement in query (2003)

    Try this:
    <code>
    IIf([Group Market Status] In (2, 100), [FaContracts], 0)
    </code>
    or
    <code>
    IIf([Group Market Status] = 2 Or [Group Market Status] = 100, [FaContracts], 0)</code>

Posting Permissions

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