Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2003
    Location
    N. Andover, Massachusetts, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Expressions

    Help. I am using Access 2000. I have linked to a table which is refreshed every night and created a query. In this query I need to build an arithmetic calculation as an expression (exp1, exp2) using two fields. The arithmetic calculation is different based on a third field. If the third field is code 1 then I add field 1 & 2, if it is code 2 then I subtract 1 from 2. I know how to create the expression to add or subtract but not the If - then part. Any help will be greatly appreciated.

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Expressions

    Assuming that fld3 will always by either 1 or 2 the statement would look like: IIf([fld3]=1,[fld1]+[fld2],[fld2]-[fld1])

  3. #3
    New Lounger
    Join Date
    May 2003
    Location
    N. Andover, Massachusetts, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Expressions

    Thanks, It worked Great

Posting Permissions

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