Maybe IIF, I don't know Round 2!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Presto731
    New Member
    • Jul 2007
    • 53

    #1

    Maybe IIF, I don't know Round 2!!

    I would prefer to do this with an IFF statement as it would be the easiest way for me to continue with the project.

    Here is what I need. in a table will be a number. based on that number three values can arrise, we will call that number x and the threshold will be y and the resulting value will be z

    Here are the three resulting values

    if X is less than Y, then Z will equal a calculation based on a certain value
    if X is equal to Y then Z equals 0
    if X is greater than Y then Z equals 50

    Please help put this together in my query.

    Thanks ini advance
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. Two IIFs nested will do what you require, replacing the placeholder {your calculation goes here} with your actual calculation:

    IIF(X=Y, 0, IIF(X>Y, 50, {your calculation goes here}))

    -Stewart

    Comment

    • Presto731
      New Member
      • Jul 2007
      • 53

      #3
      Originally posted by Stewart Ross Inverness
      Hi. Two IIFs nested will do what you require, replacing the placeholder {your calculation goes here} with your actual calculation:

      IIF(X=Y, 0, IIF(X>Y, 50, {your calculation goes here}))

      -Stewart

      that looks like what I was needing. Thank you i will try it

      Comment

      • Presto731
        New Member
        • Jul 2007
        • 53

        #4
        Thanks Stewart that was exactly what I needed!!!

        Comment

        Working...