E
efandango
I have a Parent table and child table.
I want to delete any Parent record that has an empty sub child record. Not
having a sub is determined by the sub childs fields being null. The empty
fields in the sub child table are:
Run_Direction
Run_waypoint
Postcode
These are my two tables:
Parent table: tbl_Getrounds
Field:
GetRound_ID (Autonumber)
GetRoundPoint (text)
Child Table: tbl_Getround_Detail
Fields:
GetRound_Detail_ID (Autonumber)
GetRound_ID (linked to parent PK)
Run_Direction
Run_waypoint
Postcode
This is my SQL:
SELECT tbl_Getrounds.GetRound_ID, tbl_Getrounds.GetRoundPoint,
tbl_Getround_Detail.Run_Direction, tbl_Getround_Detail.Run_waypoint,
tbl_Getround_Detail.Postcode
FROM tbl_Getrounds LEFT JOIN tbl_Getround_Detail ON
tbl_Getrounds.GetRound_ID = tbl_Getround_Detail.GetRound_ID
WHERE (((tbl_Getround_Detail.Run_Direction) Is Null) AND
((tbl_Getround_Detail.Run_waypoint) Is Null) AND
((tbl_Getround_Detail.Postcode) Is Null))
ORDER BY tbl_Getrounds.GetRoundPoint;
I want to delete any Parent record that has an empty sub child record. Not
having a sub is determined by the sub childs fields being null. The empty
fields in the sub child table are:
Run_Direction
Run_waypoint
Postcode
These are my two tables:
Parent table: tbl_Getrounds
Field:
GetRound_ID (Autonumber)
GetRoundPoint (text)
Child Table: tbl_Getround_Detail
Fields:
GetRound_Detail_ID (Autonumber)
GetRound_ID (linked to parent PK)
Run_Direction
Run_waypoint
Postcode
This is my SQL:
SELECT tbl_Getrounds.GetRound_ID, tbl_Getrounds.GetRoundPoint,
tbl_Getround_Detail.Run_Direction, tbl_Getround_Detail.Run_waypoint,
tbl_Getround_Detail.Postcode
FROM tbl_Getrounds LEFT JOIN tbl_Getround_Detail ON
tbl_Getrounds.GetRound_ID = tbl_Getround_Detail.GetRound_ID
WHERE (((tbl_Getround_Detail.Run_Direction) Is Null) AND
((tbl_Getround_Detail.Run_waypoint) Is Null) AND
((tbl_Getround_Detail.Postcode) Is Null))
ORDER BY tbl_Getrounds.GetRoundPoint;