IIF Statement followed by Calculation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • unagi
    New Member
    • May 2012
    • 3

    IIF Statement followed by Calculation

    I have attempted a few times using various form of IF statement to do following the calculation in Access 2007:

    Inventory Position: (IIf([Remaining Days Before Parts Available]>[the Days before Fulfillment],[On Hand Inventory],[On-Hand Plus Pipeline])-[Unfulfilled Qty])

    However it didn't work. Does anyone know how I should correct this calculation? Thanks!
  • dsatino
    Contributor
    • May 2010
    • 393

    #2
    IIf([Remaining Days Before Parts Available]>[the Days before Fulfillment],[On Hand Inventory],[On-Hand Plus Pipeline]-[Unfulfilled Qty])

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      What do you mean by it doesn't work?

      Comment

      • unagi
        New Member
        • May 2012
        • 3

        #4
        dsatino-Thank you for statement. Sorry that I didn't clarify the equation. What I try to calculate is if [Remaining Days before Parts Available] > [the Days before Fulfillment], the the inventory position will equal to [On Hand Inventory]- [Unfulfilled Qty]; If [Remaining....] <[the Days before...], inventory position will equal to [On-Hand Plus Pipeline]-[Unfulfilled Inventory].

        Comment

        • unagi
          New Member
          • May 2012
          • 3

          #5
          Rabbie- The result was blank and I'm sure which part of the statement is wrong.

          Comment

          • dsatino
            Contributor
            • May 2010
            • 393

            #6
            Well, what I gave you was the correct syntax. You simply had too many parantheses.


            In general the IIF function is as follows:

            IIF([statement to evaluate], result/expression where statement is true, result/expression where statement is false)


            for example:

            IIF(5>4,"YES!!! ","no....") would return: YES!!!

            whereas

            IIF(4>5,"YES!!! ","no....") would return: no....

            Comment

            Working...