Query 2 tables

R

RuudM

Hi,

Hope someone can help me with the folowing problem:

I have 2 tables, members and tickets, related to eachother with the
unique field "id". Now I would like to extract all the members without a
ticketorder into a query.

translated (used to be in Dutch ;-):

SELECT DISTINCTROW members.Id, tickets.orderDate
FROM members INNER JOIN tickets ON members.Id = tickets.id
WHERE (tickets.orderdate) Is Null));

This results in no row at all.

The tickets table is only filled with orders from certain members, so
that is why I tried it with orderdate Is Null (or Nz or "", but that
didn't work also).
Somehow I got the feeling that I am searching in a totally wrong
direction......

Thx for any suggestions,

Ruud Mastbergen
Netherlands
 
R

RuudM

Roxie, a powerfull answer which worked. And learned about the difference
between INNER and LEFT.

Thanks!

R.\\
 

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