Results 1 to 5 of 5
  1. #1
    mohara is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2010
    Posts
    2

    Help with Query Total


    I am very new at access and need to complete a project at work. I am not very good at sql but can understand some.

    I have a table that consists of 500 product labels.

    column headings are Label, description, # per roll, May 2010, June 2010 etc.

    What I have is an inventory of all labels by month (starting at May 2010 to May 2011) As this is a new project I only have values for May 2010. For testing purposes I have entered a few values in June. When I make a new select query, I select the fields that I want to show and then enter the following in an empty field:

    totals:[may 2010]+[june 2010]

    The problem is that it only adds the values that exist in both may and june. It will not pull the values from may and enter it unless I have a 0 in the june field.

    What am I doing wrong? Sorry if this is a dumb question but my books aren't giving me a clear answer.

    Thanks for the help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    For starters, it's almost certainly a design mistake to have a field for each month (search on normalization). I suspect you'll be working around this in many areas. In any case:

    totals:Nz([may 2010], 0) + Nz([june 2010], 0)

    But I'd strongly suggest revisiting the design.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mohara is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2010
    Posts
    2
    Thanks for the reply. I am working with pre-existing data however, I was thinking the design was the problem and of course, you just verified. Just trying to figure out a quick way around. This will get me the report I need and I can re-work the design

    Thanks for the help! Michele

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help Michele, and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Please mark it as Solved.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-04-2010, 01:15 PM
  2. Total all months in query or report
    By Brian62 in forum Queries
    Replies: 2
    Last Post: 10-23-2009, 08:41 AM
  3. Using running total in query to create graphs
    By maggioant in forum Queries
    Replies: 4
    Last Post: 10-02-2009, 05:58 AM
  4. Total a Query
    By Bridgid in forum Queries
    Replies: 0
    Last Post: 09-05-2009, 02:51 PM
  5. computing total sales per day using query
    By joms222 in forum Queries
    Replies: 0
    Last Post: 03-09-2009, 10:58 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