G
Guest
SELECT
IIf(IsNull(Sum([vend_div_vol]![vendvolume])),Sum([OPDS2_Div_Vol]![DivVolume]),IIf(IsNull(Sum([OPDS2_Div_Vol]![DivVolume])),Sum([vend_div_vol]![vendvolume]),Sum([vend_div_vol]![vendvolume])+Sum([OPDS2_Div_Vol]![DivVolume]))) AS Volume
FROM ((OPDS2_Div_Vol INNER JOIN Terminals_Chosen ON OPDS2_Div_Vol.Terminal =
Terminals_Chosen.Terminal_ID) INNER JOIN Months_Chosen ON OPDS2_Div_Vol.Month
= Months_Chosen.Month) INNER JOIN vend_div_vol ON
(Terminals_Chosen.Terminal_ID = vend_div_vol.SAPID) AND (Months_Chosen.Month
= vend_div_vol.MONTH);
How come this doesn't work? The problem is that OPDS2 doesn't have the
specified SAP_ID so there is no volume, but I want it to see that its null
and then just return the other part of the calculation. Please Help!
IIf(IsNull(Sum([vend_div_vol]![vendvolume])),Sum([OPDS2_Div_Vol]![DivVolume]),IIf(IsNull(Sum([OPDS2_Div_Vol]![DivVolume])),Sum([vend_div_vol]![vendvolume]),Sum([vend_div_vol]![vendvolume])+Sum([OPDS2_Div_Vol]![DivVolume]))) AS Volume
FROM ((OPDS2_Div_Vol INNER JOIN Terminals_Chosen ON OPDS2_Div_Vol.Terminal =
Terminals_Chosen.Terminal_ID) INNER JOIN Months_Chosen ON OPDS2_Div_Vol.Month
= Months_Chosen.Month) INNER JOIN vend_div_vol ON
(Terminals_Chosen.Terminal_ID = vend_div_vol.SAPID) AND (Months_Chosen.Month
= vend_div_vol.MONTH);
How come this doesn't work? The problem is that OPDS2 doesn't have the
specified SAP_ID so there is no volume, but I want it to see that its null
and then just return the other part of the calculation. Please Help!