Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: IIf Statement using %

    I have two fields that i want to use:

    TotalTime
    StdTime

    I am tryting to say that if the total time is less than 5% or more than 5% of the StdTime then i want to return a true if not i want a false,

    i have tried this but i know it aint right but can't get it to work,

    StdLevel: IIf( [qCPPlannedstopsData]![Total] >5% or <5% [qCPPlannedstopsData]![StdRestartTime] , 1, 0)

    Please help

    Andy

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    <5% or >5% is the same as <>5%
    and by reversing the true/false you can replace <>5% with =5%
    and dividing instead of messing with %

    IIf( [qCPPlannedstopsData]![Total]/[qCPPlannedstopsData]![StdRestartTime] = 0.05 , 0, 1)

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ooops!

    before pootle gets on my case about float imprecision, i should warn you that it is unlikely to work as posted.

    assuming you dont overflow, have a go with
    IIf( 100*[qCPPlannedstopsData]![Total]\[qCPPlannedstopsData]![StdRestartTime] = 5 , 0, 1)

    and you might want to try
    1000* and 50
    10000* and 500
    etc to see if you get the result you are looking for


    izy
    Last edited by izyrider; 05-10-06 at 13:04.
    currently using SS 2008R2

Posting Permissions

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