- Total Members: 220,027
- Threads: 525,388
- Posts: 976,998
-
January 5th, 2013, 12:37 PM
#1
SQL help finding court cases where all children have been closed.
Hi all -
I know the title is confusing but I need help finding the court cases where all children associated with that case have a programClosureDate.
I can run this query:
CaseInfo Table
CaseID,
CaseNumber,
CaseName
CaseChild Table
CaseID, FK to CaseInfo
ChildPartyID, FK to PartyID in Party table
ProgramClosureDate
Party Table
ID,
PartyID,
Firstname,
LastName
SELECT ci.CaseNumber, ci.CaseName, p.firstname+' '+p.lastname AS child, cc.programClosureDate
FROM CaseInfo ci JOIN
CaseChild cc ON ci.CaseID = cc.CaseID JOIN
Party p ON cc.ChildPartyID = p.PartyID
WHERE cc.ProgramClosureDate IS NOT NULL
ORDER BY ci.CaseName
But this does not give me the cases where all the children have programCLosureDate IS NOT NULL.
Any help is greatly appreciated.
Andy
-
January 7th, 2013, 07:55 AM
#2
Why not just simple
Select distinct CaseID from CaseChild where ProgramClosureDate is null
GK
__________________________________________________ _____
if you found this post is useful click scale

(right side on this reply ) and agree
-
January 18th, 2013, 04:34 PM
#3
Maybe:
WHERE NOT cc.ProgramClosureDate IS NULL
Last edited by June7; January 18th, 2013 at 04:38 PM.
-
January 22nd, 2013, 08:18 AM
#4
June7
if you need not it will be
WHERE cc.ProgramClosureDate IS NOT NULL
Similar Threads
-
By RSS_News_User in forum Business News
Replies: 0
Last Post: March 29th, 2012, 03:00 AM
-
By RSS_News_User in forum Technology News
Replies: 0
Last Post: October 24th, 2007, 12:05 PM
-
By RSS_News_User in forum Technology News
Replies: 0
Last Post: March 10th, 2006, 01:06 AM
-
By RSS_News_User in forum Technology News
Replies: 0
Last Post: March 9th, 2006, 11:03 PM
-
By RSS_News_User in forum Science News
Replies: 0
Last Post: October 11th, 2005, 10:04 AM