sh98110,
You can use a strait JOIN:
JOIN LEFT_OUTER
BKIncidentNumber IN vIncident TO {UNIQUE | MULTIPLE} BKIncidentNumber IN vIncidentRelationships
AS B
END
JOIN LEFT_OUTER
BKRelatedItemID IN vIncident TO {UNIQUE | MULTIPLE} BKProblemInvestigationID IN BKProblemInvestigationID
AS P
END
And in your TABLE request add the condition on RelatedItemType.
Or you could use a WHERE-based JOIN:
JOIN LEFT_OUTER FILE vIncident AT BKIncidentNumber TAG I
TO {UNIQUE | MULTIPLE}
-* Choose one of the above
FILE vIncidentRelationships AT BKIncidentNumber TAG B
WHERE I.BKIncidentNumber EQ B.BKIncidentNumber;
WHERE B.RelatedItemType EQ 'Problem Investigation';
END
For the second JOIN, you join the new structure to the third file:
JOIN LEFT_OUTER FILE vIncident AT B.BKRelatedItemID
TO {UNIQUE | MULTIPLE}
-* Choose one of the above
FILE vProblemInvestigation AT BKProblemInvestigationID TAG P
WHERE B.BKRelatedItemID EQ P.BKProblemInvestigationID ;
WHERE B.RelatedItemType EQ 'Problem Investigation';
END
Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF