Results 1 to 3 of 3

Thread: Calculations using if statement

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Posts
    3

    Calculations using if statement

    This is what I have
    Code:
    If Me.liftingdevicetotal = 0 Then
    Me.Grade = ([preusetotal] + [traveltotal] + [deposittotal] + [stackingtotal] + [parkingtotal]) / 100 * 1
    Else
    Me.Grade = ([preusetotal] + [traveltotal] + [deposittotal] + [stackingtotal] + [parkingtotal] + [liftingdevicetotal]) / 105 * 1
    End If
    is there away this could be done in a query?

  2. #2
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    In a field of your column in your query add my_result:iif([liftingdevicetotal] = 0,([preusetotal] + [traveltotal] + [deposittotal] + [stackingtotal] + [parkingtotal]) / 100 * 1,
    ([preusetotal] + [traveltotal] + [deposittotal] + [stackingtotal] + [parkingtotal] + [liftingdevicetotal]) / 105 * 1)

    Change my_result to a suitable otherwise the query will add Expr1: to the field.
    Allan

  3. #3
    Join Date
    Feb 2010
    Posts
    3
    Thank you very much!

Tags for this Thread

Posting Permissions

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