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 can I make this work? I'm still getting nothing when I run the query.
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 can I make this work? I'm still getting nothing when I run the query.