Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Master-Detail

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-29 : 07:23:28
Stéphane writes "Hi,


I have a problem. Here are my table sets :

tblRequest - Master Table
tblTasks - Detail Table (some fields include Completed, and completed can be null or not null)
(a request can have many tasks...)

What do I do if I want to select all the request that has at least One task not done?

Example :

if I do
"SELECT * from tblTasks INNER JOIN tblRequest ON (tblRequest.Site = tblTasks.Site) AND (tblTasks.requestno = tblRequest.requestno) where tblTask.Completed is Null"

when I do this, SQL returns Duplicate Request Numbers , and that's not what I want....even when I do distinct. I only want the Request Number in the query if, at least, a task is not completed....and I have other criterias in both tables.

Thanks,

Stéphane"
   

- Advertisement -