Results 1 to 6 of 6
  1. #1
    racefan91 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    56

    Adding Columns in a Query

    I am trying to do some calculations in a query but can't figure out why it's doing things this way. When I added Total Wins + Total Losses to get Total Matches it works fine but now when I try to add Round One Wins + Round One Losses it doesn't seem to work. To me it looks like it putting the two numbers next to each other instead of doing the addition. This is what I put in the field name:



    Total Round One Matches: [Round One Wins]+[Round One Losses]

    Click image for larger version. 

Name:	Query.jpg 
Views:	7 
Size:	82.9 KB 
ID:	13945

    Any help is greatly appreciated.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You might try:
    Int([Round One Wins])+Int([Round One Losses])
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    racefan91 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    56
    Brilliant! That did the trick. Do you know why this formula needed the Int in front and my other formula to calculate the total didn't?

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    I think it may be because one or both of the fields are data type text in the table. When you look at the data in the columns they are left justified but numbers are usually right justified.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    racefan91 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    56
    Is that something that can be changed in a crosstab query? I used one on my table to calculate the wins. Or can that be changed in my new query in which i pulled the "numbers" from the crosstab?

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    If you want to change the data type of the fields you would need to do that in the table.
    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. Replies: 3
    Last Post: 06-25-2013, 10:57 AM
  2. Replies: 4
    Last Post: 05-14-2012, 10:15 AM
  3. Replies: 1
    Last Post: 10-09-2009, 11:52 AM
  4. Adding columns that contain blanks.
    By Tony McGuire in forum Access
    Replies: 11
    Last Post: 05-31-2009, 12:58 PM
  5. Adding Two Columns
    By arthura in forum Queries
    Replies: 6
    Last Post: 05-01-2009, 08:38 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