Help with Group By

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have two tables, one (the right) including customer details including a
product code and a second (the left) that maps product codes into (bigger)
classes.

I then want to run a query that groups by classes. So far so good!

However there are some classes that we have not sold; these do not show up
on the query. I want the query to show all classes (and ideally put zeros
where there has been no sales). I thought a left join would sort it, but
still only get classes that have been sold.

Any thoughts out there in Access-land? :o)

Thx
 
Try this:

Double click the relationship line in the design view of your query. Select
to show all records from table classes.

George

Ο χÏήστης "Muttley" έγγÏαψε:
 
Please copy and post the SQL of your query.

(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message

It could be you need a right join instead of a left join or it could be that
you have applied criteria to fields in the "Customers" table that would
eliminate the Nulls. You **might** need to use something like

WHERE (Customer.SomeField = "whatever" or Customer.SomeField Is Null) AND
(Customer.SomeOtherField = 10 or Customer.SomeOtherField is Null)
 
Back
Top