Results 1 to 5 of 5
  1. #1
    PATRICKPBME is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    171

    Simple Math Functions - I just want to subtract within a report!


    This was so easy in Excel I figure I just must be missing something. I have a report that contains two fields, each from a different table. The record in each field is a dollar amount. All I want to do is subtract one field from the other so I can have the difference listed on the report.

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    If both fields are in your query for the report RecordSource, then return a new field in the query with the result of subtracting one field from another, such as: CalculatedValue: [tblTable1].[Field1] - [tblTable2].[Field2]

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would also do it in the query, but FYI you can do it on the report. A textbox with a control source of:

    =Field1 - Field2

    should work.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    PATRICKPBME is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    171
    Thank you! I did it on the report and it appears to be working! However, for some of the results instead of a figure I am getting "#Type!" as a result. I am wondering if this is telling me that the numbers I am working with are not formatted in the same way? I will check that. Thank you again.

    PS Think I found the problem. Misplaced decimal point!

    Quote Originally Posted by pbaldy View Post
    I would also do it in the query, but FYI you can do it on the report. A textbox with a control source of:

    =Field1 - Field2

    should work.

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it working.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 12-29-2014, 11:27 AM
  2. Replies: 1
    Last Post: 10-18-2013, 02:17 PM
  3. Replies: 0
    Last Post: 07-13-2011, 08:32 AM
  4. Simple math
    By Lee in forum Programming
    Replies: 2
    Last Post: 07-27-2010, 04:53 PM
  5. simple math coding for form field??
    By RCBNewbee in forum Programming
    Replies: 7
    Last Post: 07-13-2009, 08:30 AM

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