954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Query help

Dear All,
I got a query where I would like to select the clientName from tblClient but with condition that this clientID does not exist in another table call tblCDSValidity. I tried like this but it failed.

SELECT tblClient.clientID, tblClient.clientName FROM tblClient,tblCDSValidity Where tblClient.clientStatus='a' And tblClient.clientID!=tblCDSValidity.clientID ORDER BY tblClient.clientName
newbie14
Posting Pro
544 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 
SELECT clientID, clientName 
FROM tblClient
WHERE clientStatus='a' 
AND clientID NOT IN (SELECT clientID FROM tblCDSValidity)
ORDER BY clientName
pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

Dear Prit,
It works great thank you very much.

newbie14
Posting Pro
544 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

Please mark this thread as solved.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

Dear Prit,
I cannot find the option to mark it solved?

newbie14
Posting Pro
544 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

It's below, near the reply box. A text-link "mark as solved" if I remember correctly.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

Dear Prit,
Ok done. Thank you.

newbie14
Posting Pro
544 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: