showing 0 if no results

Julie123

New member
Local time
Today, 23:24
Joined
Jul 6, 2006
Messages
6
Hi

I have a query which is made up of several other queries that total different fields (these are a base for a report) sometimes one of the queries will be empty and then the whole query is blank, how can I return 0 when there are no records to count in 1 query so that the results from the others still show?

Thanks
 
Julie,

Without looking at it, I'd say that you need to replace the "Inner Joins" in
your query with Left Joins. Possibly using the Nz function to supply a value
of 0 for the right-hand fields that are unmatched.

hth,
Wayne
 
Hi

There are no joins they are all independent of each other, with just counts from different fields to put into a report.
 
Julie,

I'd still have to see the queries. What type of query is returning no rows?

If you are getting no rows in an intermediate query, then even the Nz function isn't gonna help.

Wayne
 
Each query is counting the number of responses to several questions so if that question has no responses the query is blank, I have to fill in a spreadsheet with the responses to each question, I am trying to build a report that will give me the answers so that I can fill in the spreadsheet faster, but when one of the queries is blank, all the other queries return blank as well.
 
Julie,

What Wayne is politely saying is, we need to see the queries your are talking about.
Please can you provide examples. If you are not sure how to do this...

In the design view select 'SQL' from the left most menu button in the toolbar, copy and paste the the text, with an explanation of what should be happening with some example data.

Having just re-read what you trying to do it sounds like you are going to need to join the queries using Left Joins. the left side will have a query which contains all the data and the right all the queries which could potentially have no results. But with-out the examples that's the best I can think of.

Thanks,
 

Users who are viewing this thread

Back
Top Bottom