Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with query 1

Status
Not open for further replies.

pkailas

Programmer
Jun 10, 2002
555
US
I have 2 tables
Code:
Invoices106
DocTypeRecNum     KeywordNum
9                 100
10                102

Keywords
KeywordID    KeywordName    DataType    Length
100          Invoice Number adVarWChar  50
101          Invoice Date   adDate
102          Vendor Name    adVarWChar  100
The result I need is from the Keywords table
Code:
KeywordID    KeywordName    DataType    Length
101          Invoice Date   adDate
In other words, I need to find which KeywordID's are in the Keywords table but NOT in the Invoices106 table.
 
Try this...

SELECT KeywordID, KeywordName,DataType, Length FROM Keywords WHERE KeywordID NOT IN (SELECT KeywordNum FROM Invoices106)

-L

 
Thanks. I had already figured that out, but your answer is correct and therefore worth a start!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top