Results 1 to 2 of 2
  1. #1
    pekimojoe is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    2

    How do i use the IIF query for my equation.


    Hello guys, new to the forum and access...

    Have a basic question that i cant seem to work out... Basically i want to achieve a calculated field in a query IF a condition is met.

    The question i want to answer is... IF a [field] = null (no value) then i want to subtract a [field] from another [field].

    Example: If [Field1]Is Null, [Field2]-[Field3]



    Thanks in advance!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Take a look at the IIF() function: https://support.office.com/en-gb/art...ad=GB&fromAR=1
    Maybe something like:
    Result:IIF(IsNull([Field1]), [Field2]-[Field3],"")
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help with Sum equation in forms
    By Buckles in forum Forms
    Replies: 10
    Last Post: 07-05-2015, 10:45 AM
  2. Equation help
    By Thompyt in forum Programming
    Replies: 7
    Last Post: 05-15-2015, 05:31 PM
  3. Replies: 7
    Last Post: 08-28-2014, 01:33 PM
  4. Making an equation
    By joce in forum Access
    Replies: 1
    Last Post: 10-27-2011, 09:56 AM
  5. Another equation almost done now
    By stryder09 in forum Access
    Replies: 4
    Last Post: 02-18-2011, 12:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums