Solved

SQL to retrieve data

Posted on 2000-03-16
4
186 Views
Last Modified: 2010-05-02
Hello
I have two tables related by common field.
1ª table-Clients
2º table-invoices
common field->clientID
In SQL, how can I retrieve clients from the first table that have not invoices in the second table.
I'm working with VB 6.0

Thanks
0
Comment
Question by:asimoes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
JHausmann earned 50 total points
ID: 2625037
select * from clients where clientid not in(select distinct clientid from invoices)
0
 

Expert Comment

by:PatriceF
ID: 2626858
Select * from Clients left join Invoices on
Clients.ClientID = Invoice.ClientID
where Invoices.ClientID is null
0
 
LVL 2

Expert Comment

by:JHausmann
ID: 2628940
I realize you're new Patrice so I hope that I don't sound too harsh. When someone posts a comment in this group (and not all of the groups work the same way, you're just going to have to learn which ones do/don't over time), you should also post a comment. You then leave it up to the person who posed the  question to decide which answer best suits his/her needs.

As it stands now, because you "answered" the question, you will default to getting the points if the person that answered the question does not accept your answer after a certain period of time.

Welcome to Expert Exchange, BTW.
0
 

Expert Comment

by:PatriceF
ID: 2635007
Sorry, this is my answer as a comment...
Select * from Clients left join Invoices on
Clients.ClientID = Invoice.ClientID
where Invoices.ClientID is null
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 52
How to measure sizes and angles in scanned images ? 3 89
clicking a shape in a frame array vb6 3 48
Excel Automation VBA 19 104
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question