The "count" function

G

Guest

I'm using the count function in a query with qualifying criteria. In some
cases no records meet the criteria, so no records are created by the query.
What I need is a record to be created with a zero in the count field.
Assistance appreciated. Thx
 
M

Marshall Barton

Big said:
I'm using the count function in a query with qualifying criteria. In some
cases no records meet the criteria, so no records are created by the query.
What I need is a record to be created with a zero in the count field.


When asking a question about a query (or an expression or
VBA code), you should post a Copy/Paste of the query so we
can see what you are talking about.

At this point, all I can say is that you probably need to
use a LEFT JOIN from from the table with the categories(?)
to the table that you are counting the matching records.
 
G

Guest

Marshall:

Here's the code, and this query is running against only one table.

SELECT Count(Foursomes.[Player 1 Name]) AS [Player 1 Not Paid],
Foursomes.[Paid 1], Foursomes.Player1, Foursomes.FoursomeYN,
Foursomes.SPlayer2, Foursomes.SPlayer4
FROM Foursomes
 
M

Marshall Barton

Big said:
Here's the code, and this query is running against only one table.

SELECT Count(Foursomes.[Player 1 Name]) AS [Player 1 Not Paid],
Foursomes.[Paid 1], Foursomes.Player1, Foursomes.FoursomeYN,
Foursomes.SPlayer2, Foursomes.SPlayer4
FROM Foursomes


What about player 3?

I don't see how that query can work at all. You can not use
an aggregate function along with another field without using
a GROUP BY clause. Are you sure you used Copy/Paste to post
the query?

There isn't even any criteria so I can not relate your
question to the query.
 

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

Similar Threads


Top