Results 1 to 5 of 5
  1. #1
    HTFC is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    6

    Help with adding the values in two columns in a query.

    Hi all,



    Bit of a newbie here to both this forum and access as a whole.

    As soon as I got home today I was greeted by this problem by my second job. So because of this please help and let me get to bed!

    There are two columns from two tables, one called fd_goals and another called fd_goalsnew. What I need to do is in a new column in the design view maybe (I am sure this is where it goes) is write some formula to add the two together.

    I can do this using a text box in a report but I need that text box to be the lead sorting box and ascend in order - another area I need to study.

    I am so sure that it is using the formula sum or total but I am getting so tired that I can hardly concentrate any more.

    Thanks in advance for any help.

  2. #2
    HTFC is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    6
    I also ment to put that I have searched the forum already but cannot find an answer although as stated, I am so tired that I am probably missing the blatently obvious. If so I apologise in advance.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Try this in the "Field" row (that's the first line) of the third column:
    Code:
    TotalGoals:Nz([fd_goals],0) + Nz([fd_goalsnew],0)
    This is untested but it should add the two fields together in a third column called "TotalGoals". The Nz() function will convert any Null values to 0.
    I hope you feel better for the sleep
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    HTFC is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    6
    Genius, thank you so much - I really appreciate it! I got the code but would never have got the Null values in a million years.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by HTFC View Post
    Genius, thank you so much - I really appreciate it! I got the code but would never have got the Null values in a million years.
    Thanks for the compliment, but I am no genius. I've just spent too much time nosing around various Access forums and learnt something along the way that you didn't know until now. Glad to help.
    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. Adding duplicate values in a query
    By mooseisloose in forum Queries
    Replies: 3
    Last Post: 04-14-2011, 12:12 PM
  2. Adding Sequential Values to Make-Table Query
    By obrien.robj in forum Queries
    Replies: 2
    Last Post: 08-25-2010, 12:55 PM
  3. Adding tabulated values in a query
    By Govyn in forum Queries
    Replies: 3
    Last Post: 06-28-2010, 12:51 PM
  4. Adding tabulated values in a query
    By Govyn in forum Access
    Replies: 0
    Last Post: 06-28-2010, 08:56 AM
  5. Replies: 1
    Last Post: 10-09-2009, 11:52 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