Query displays no records, want it to display Zero instead

K

kirstenlargent

I currently have multiple queries that use the Count
function. I have them all combined into one main query
(not joined, just showing one single row with counts).
My problem is that some of the Count queries do not find
any records (and that is correct, there are currently no
records meeting the criteria). But when the queries find
no records, they display nothing, so the main query that
combines them all displays nothing, even when some of the
other queries have actual number results for their
count.

Example: Query1 count is 6. Query2 count is 34. Query3
count is nothing, no records found. One main query to
join Query1 and Query2 displays counts of 6 and 34. But
if I add Query3, no results are displayed for ANY of the
queries.

I'm trying to find a way to make the queries that do not
find any records display Zero. Is that possible? Or any
way you can think of where the actual valid counts would
display, even if some of the other counts returned no
records? THANKS!
 
V

Van T. Dinh

I am not sure of your result for Query3. If you use Count in Query3 (or in
fact, any Query), the return of Count will show 0 if no row is selected.
For example, for an empty Table7, the following SQL return 1 row with 1
Field value 0.

SELECT Count(*) AS CountOfRecord
FROM Table7;

Post the SQL Strings of your main Query and Query1 and Query3.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top