I need to join a table (qryDCFForecasts) to a subquery (z). The subquery includes all possible criteria combinations for the following two fields: "fldPkg", "fldDCF"
Both (qryDCFForecasts) and the subquery (z) include both fields.
qryDCFForecasts does not include all possible combinations of fldPkg and fldDCF. However I still need to return records for all combinations. Therefore I am attempting to Outer Join qryDCFForecasts with subquery (z) - which lists all possible combinations. However I need to use both as criteria in the join.
In the below code, the WHERE statement below is filtering out Nulls from qryDCFForecasts. Do you have suggestions on how to include Null records from qryDCFForecasts?
Thank you for the help.
Both (qryDCFForecasts) and the subquery (z) include both fields.
qryDCFForecasts does not include all possible combinations of fldPkg and fldDCF. However I still need to return records for all combinations. Therefore I am attempting to Outer Join qryDCFForecasts with subquery (z) - which lists all possible combinations. However I need to use both as criteria in the join.
In the below code, the WHERE statement below is filtering out Nulls from qryDCFForecasts. Do you have suggestions on how to include Null records from qryDCFForecasts?
SELECT z.fldPkg, z.fldDCF, qryDCFForecasts.fldValue
FROM
(SELECT zz.fldPkg, yz.fldDCF
FROM
(SELECT DISTINCT fldDCF FROM tblBudget) as yz,
(SELECT DISTINCT qryForecast.fldPkg FROM qryForecast) as zz
) AS z
LEFT OUTER JOIN
qryDCFForecasts ON z.fldDCF=qryDCFForecasts.fldDCF
WHERE z.fldPkg=qryDCFForecasts.fldPkg;
Thank you for the help.