Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: SQL help finding court cases where all children have been closed.

Results 1 to 4 of 4
Share This Thread →
  1. #1
    acicchillo is offline Registered User
    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    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

  2. #2
    gk53's Avatar
    gk53 is offline Contributing User
    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,535
    Rep Power
    278
    Why not just simple

    Select distinct CaseID from CaseChild where ProgramClosureDate is null
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

  3. #3
    June7's Avatar
    June7 is offline Moderator
    Join Date
    Apr 2009
    Location
    The Great Land
    Posts
    4,618
    Rep Power
    649
    Maybe:

    WHERE NOT cc.ProgramClosureDate IS NULL
    Last edited by June7; January 18th, 2013 at 04:38 PM.
    I like to know if my suggestion helped you. One way to let me know is by clicking star at bottom left corner of post.
    Debug!Debug!Debug!http://www.cpearson.com/excel/debug.htm

  4. #4
    gk53's Avatar
    gk53 is offline Contributing User
    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,535
    Rep Power
    278
    June7
    if you need not it will be
    WHERE cc.ProgramClosureDate IS NOT NULL

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Court takes health care case behind closed doors
    By RSS_News_User in forum Business News
    Replies: 0
    Last Post: March 29th, 2012, 03:00 AM
  2. Microsoft abandons remaining EU court cases (AFP)
    By RSS_News_User in forum Technology News
    Replies: 0
    Last Post: October 24th, 2007, 12:05 PM
  3. China Creates Court for Piracy Cases (AP)
    By RSS_News_User in forum Technology News
    Replies: 0
    Last Post: March 10th, 2006, 01:06 AM
  4. China Creates Court for Piracy Cases (AP)
    By RSS_News_User in forum Technology News
    Replies: 0
    Last Post: March 9th, 2006, 11:03 PM
  5. Supreme Court to Take Up Wetlands Cases (AP)
    By RSS_News_User in forum Science News
    Replies: 0
    Last Post: October 11th, 2005, 10:04 AM

ASP Free Advertisers and Affiliates