473,399 Members | 3,832 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,399 software developers and data experts.

Problems Using Count Queries

I've run into a little problem with a form I'm trying to make, and I think it has to with my query design. Here's what I'm trying to do:

I have query 1, query 2 and query 3. Query one counts all the rows with a "1" in column A, query 2 counts all the rows with a "2" in column A and query 3 counts all the rows with a "3" in column A.

Basically, the problem happens if any of these counts happens to be 0. Instead of a 0 coming up as the result of the query, the results will just be blank.

This normally wouldn't be a problem, but when I try to include these query results in another query or a form, it makes the whole query or form display nothing, not just the query that should be blank.

Any thoughts?

Edit: I'm using Access 2007
Feb 2 '09 #1
3 1408
ChipR
1,287 Expert 1GB
You can add a column to your query and set it to Expression. Use

nz(Count([column A]),0)

That will give you a zero even if there are no matching records.
Feb 2 '09 #2
Not quite getting it. Right now I have 2 columns in my query.

Column 1 has:
Table: "Master"
Field: "ID"
Total: "Count"
And this column is showing

Column 2 has:
Table: "Master"
Field: "Source"
Total: "Group by"
Criteria: "1"
And this column is not showing.

And the problem obviously comes when there are no values of "1" inside of the column named source.

Are you saying I should ass in another column? What would I put in for the table and field? And where would I put in the expression you suggested? In criteria?
Feb 2 '09 #3
ChipR
1,287 Expert 1GB
Right, add another column. Set
Total: "Expression"
Field: "WhatEverNameYouWant: nz(count(ID),0)"
Table is blank.
Feb 2 '09 #4

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

Similar topics

7
by: Dennis Roberts | last post by:
I have a script to parse a dns querylog and generate some statistics. For a 750MB file a perl script using the same methods (splits) can parse the file in 3 minutes. My python script takes 25...
9
by: Andrea | last post by:
Hi, I've read the former postings but was not able to solve my problem: I have a Summary Table (or MQT as you like it) and the query optimizer does not seem to use the summary table. I run...
1
by: B Moor | last post by:
Hello, I am quite bogged down with this problem and would like some tips/help if any one has any. Thanks in advance. The Problem ----------- This system initially seemed quite stable for...
2
by: Joseph Macari | last post by:
I recently installed Office2003 on my computer. I had imported (not linked) a couple of tables from an Access 2000mdb into an Access 2003mdb. I had composed various queries and forms with these...
10
by: Henk Ernst Blok | last post by:
Hi Posgres users/developers, Can anyone explain why PosgreSQL (version 7.4.5 on Linux) does a full table scan to compute a count(*) on a base table after a vacuum analyze has been done with no...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
8
by: mantrid | last post by:
Hello Im having problems working out why the following code does not work. I dont think its the sql as the error occurs on the first update which ever one is put there ($q1 or $q2). Ive swapped...
4
by: onecorp | last post by:
I have a SQL table comprised of 31 columns. The first column is simply an id column, the next 30 columns are labelled ,.... The numerical columns have a tinyint type and the data stored is either...
1
by: Paul Wagstaff | last post by:
Hi all For many years I've had a need to produce many views using (at least) these fields: Field: ID Field: User Field: DateCleared In this example, imagine the user's are reviewing a...
0
by: imusion | last post by:
Hi, I have 2 servers each running AIX and both have a DB2 database setup on them. I'm building a news management application and in our setup we need to have a staging and production setup. So...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.