Results 1 to 7 of 7
  1. #1
    mbelc is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2016
    Posts
    8

    Need help with Access formula builder - Simple Sum

    Hi,



    I am trying to get a simple sum to show up in a computed field in access...basically, for every individual record, I have a number that has been inputted for every month, and I would like the total for six months to show up in another box titled "Term 2 total." I have tried to type the following formula into the term 2 total box, but I keep getting odd or incorrect sums across records.


    =Sum([Jul])+([Aug])+([Sep])+([Oct])+([Nov])+([Dec])



    (The source titles are typed in correctly.) I am not sure what I am doing wrong. Please help me out!



    Thanks in advance.

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 10 Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    I assume that this is in a Form. Try this:

    =[Jul]+[Aug]+[Sep]+[Oct]+[Nov]+[Dec]

  3. #3
    mbelc is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2016
    Posts
    8
    Quote Originally Posted by alansidman View Post
    I assume that this is in a Form. Try this:

    =[Jul]+[Aug]+[Sep]+[Oct]+[Nov]+[Dec]
    I did try this first -- whenever I do this, I get a weird output. For instance, if I put a "1" under all six months, I get a value that is "111111". (And if I were to put a "2" in each box, the output is "222222" etc.)

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Code:
    =Sum([Jul])+([Aug])+([Sep])+([Oct])+([Nov])+([Dec])
    This is saying take the sum (ie total)of all of the [Jul] field's in the current recordset AND add the values from the current record fields [Aug], [Sep], [Oct], [Nov] and [Dec].
    So would expect the result would vary for each record....

  5. #5
    mbelc is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2016
    Posts
    8
    Quote Originally Posted by ssanfu View Post
    Code:
    =Sum([Jul])+([Aug])+([Sep])+([Oct])+([Nov])+([Dec])
    This is saying take the sum (ie total)of all of the [Jul] field's in the current recordset AND add the values from the current record fields [Aug], [Sep], [Oct], [Nov] and [Dec].
    So would expect the result would vary for each record....
    Okay good to know, so how do I just get the sum of those fields for the current record only? (Please see my above post when I stated that simply typing [Jul]+[Aug]...etc. for some reason resulted in a calculation that was all of the numbers in succession and not a sum.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Alan's formula in Post #2 should have worked.

    I did try this first -- whenever I do this, I get a weird output. For instance, if I put a "1" under all six months, I get a value that is "111111". (And if I were to put a "2" in each box, the output is "222222" etc.
    It sounds like the fields are Text type and the values are being concatenated.
    Are [Jul], [Aug], [Sep], [Oct] ,[Nov] and [Dec] fields in a table?
    If they are fields in a table, what are the field types? Number or Text?

  7. #7
    mbelc is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2016
    Posts
    8
    Quote Originally Posted by ssanfu View Post
    Alan's formula in Post #2 should have worked.


    It sounds like the fields are Text type and the values are being concatenated.
    Are [Jul], [Aug], [Sep], [Oct] ,[Nov] and [Dec] fields in a table?
    If they are fields in a table, what are the field types? Number or Text?
    Thank you so much!! Sorry I am quite the beginner -- the field types were text, when I changed them to numbers it worked perfectly.

    You are wonderful, thanks everyone for the help!

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

Similar Threads

  1. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  2. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  3. Simple Query to Retrieve a Date for a Formula
    By dgutsche in forum Queries
    Replies: 4
    Last Post: 09-08-2014, 11:55 AM
  4. Macro Builder and Code Builder
    By data808 in forum Macros
    Replies: 2
    Last Post: 01-12-2014, 11:28 AM
  5. Need help with builder formula
    By shantmov in forum Access
    Replies: 2
    Last Post: 11-11-2012, 04:09 AM

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
  •  
Other Forums: Microsoft Office Forums