473,395 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

NULL Values in Total Queries (Access 2003) Bug or Deficiency

5
Hi All

I am working on a small table of only 15 columns as below:
Project Name
Individual Staff Name
Year of Activity
Then 12 Columns for each month having time spent by each individual during that month on a given project.

I wanted to create a Total Query to come up with a Yearly total of time spent by each individual on a given project. The process is very simple just create a Total Query, use an aggregate function of SUM() and get the results. But not for me. What I have observed (just last night, and I don't know if any of you guys have already encountered this problem) is that you have to have either ZERO or a non-NULL value in each row of the coumns you are processing. Otherwise you get nothing in the Expression column of the Query.

I tried this with some values in the cells and the results were there but when I removed the data leaving only NULL Value in the cell, the resulting expression was empty.

Here is the query:
SELECT Table1.PROJECT, Table1.STAFF, Table1.W_YEAR, Sum(Table1.M_01) AS SumOfM_01, Sum(Table1.M_02) AS SumOfM_02, Sum(Table1.M_03) AS SumOfM_03, Sum(Table1.M_04) AS SumOfM_04, Sum(Table1.M_05) AS SumOfM_05, Sum(Table1.M_06) AS SumOfM_06, Sum(Table1.M_07) AS SumOfM_07, Sum(Table1.M_08) AS SumOfM_08, Sum(Table1.M_09) AS SumOfM_09, Sum(Table1.M_10) AS SumOfM_10, Sum(Table1.M_11) AS SumOfM_11, Sum(Table1.M_12) AS SumOfM_12, Sum([TABLE1.M_01]+[TABLE1.M_02]+[TABLE1.M_03]+[TABLE1.M_04]+[TABLE1.M_05]+[TABLE1.M_06]+[TABLE1.M_07]+[TABLE1.M_08]+[TABLE1.M_09]+[TABLE1.M_10]+[TABLE1.M_11]+[TABLE1.M_12]) AS Expr1
FROM Table1
GROUP BY Table1.PROJECT, Table1.STAFF, Table1.W_YEAR;

Surprised, as in real life this is not always the scenario. You may ecounter an individual who joined your project team in september only having NO hours during the first 8 months. Yes you can put zero here but in most of the cases there is a whole lot diffrence between a ZERO value and a NULL value. Think of Blood Counts in a patient whose data is not yet available. Putting ZERO here makes a lot of difference. You know what I mean. Anyway, I am posting this for the reference and your comments.

Thanks and have a good day!!!!

Jinx
Oct 16 '06 #1
2 3386
Tanis
143 100+
I think you need to treat your NULL value as Zeros. Have a look at the NZ function in the help.
Oct 16 '06 #2
Jinx
5
Thank you ... Thanks a lot. It really helped as I have a lot of NULL values in my table and I did not want to replace them with ZEROs.

I appreacite your help..

Jinx
Oct 17 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
6
by: AAVF | last post by:
Hi We have a problem with a query. An Access database links via ODBC to a UNIX server. To speed things, we use the ODBC to load the relevant tables to the local PC that runs Access so that...
5
by: Jerry Hull | last post by:
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I...
1
by: Dan | last post by:
I am linking two queries in Access. One has data in several fields such as: Name, Year, Amount, CumTotal1, CumTotal2 where the cumulative total fields are two subqueries generating cumulative...
9
by: John Sidney-Woollett | last post by:
Hi I'm building a web app where changes to customer orders are logged in the following table, and I worried about the time that it will take to locate records that need further...
18
by: WilhelmAccess | last post by:
Hi, I am trying to automate the running of a SQL Query. I have a Table in Access 2003 that contains records with several fields, (member identifier, $ amount and months during the year they were...
2
by: teddysnips | last post by:
I have an application that does some data manipulation of some tables to format a table for a report. 1. First I open the table that gives me the parameters for some later queries strSQL =...
1
newnewbie
by: newnewbie | last post by:
Desperately need help in creating a query to count unique values in a table. I am a Business analyst with limited knowledge of Access….My boss got me ODBC connection to the underlying tables for our...
10
by: Toby Gallier | last post by:
Hello! I have a form that is calculating averages as follows: " =(NZ()+Nz()+Nz())/3 " However I need to now adjust for null values , so for example if value2 is null I would then need to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.