Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formula for expression builder (2000)

    I like to have a calculated field in a report. Right now it is a sum field but I like to subtract from it without it going into negatives or limit it to zero and show only positive values.
    The expression looks like this =Sum([HoursWorked]) and should compute the overtime. I tried =Sum([HoursWorked])-38.75>0 but it doesn't give the right results in case that someone worked more than 38.75 it comes to -1.
    PS. Please keep possible response simple because I'm new in this.
    Thanks

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formula for expression builder (2000)

    Try :
    =IIf(Sum([HoursWorked])>38.75,Sum([HoursWorked])-38.75,Sum([HoursWorked]))
    Francois

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

    Re: Formula for expression builder (2000)

    Hello pgangl,

    Welcome to Woody's Lounge! Try this expression:<pre>=IIf(Sum([HoursWorked])>38.75,Sum([HoursWorked])-38.75,0)</pre>

    With the IIf (Immediate If) function, you can perform a test, and depending on the outcome, return one of two values: the first if the test results in True, the second if the test results in False.

Posting Permissions

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