SELECT
[fu].Label,
[fu].[Month End Date],
[fu]![Customer Group DESC] & " - " & Right([fu]![Customer Group ID],7) AS [Customer Group],
[fu].[SPIRITS Division],
[fu].[Outlet Name and Code CODE],
[fu].[Outlet Name and Code DESC],
[fu].[Outlet Address],
[fu].[Outlet City],
[fu].[Outlet Zip Code - 5],
[fu].[Outlet County Desc],
[fu].[Outlet State],
[fu].[Spirits Segmentation Sector],
[fu].Sector,
[fu].[NRI Segmentation Desc],
[fu].Segment,
[fu].[Reporting Agg Brand],
IIf( IsNull( [ag]![0_1L] ), 0, [ag]![0_1L] ) AS 0_1L,
IIf( IsNull( [ag]![0_2L] ), 0, [ag]![0_2L] ) AS 0_2L,
IIf( IsNull( [ag]![0_375L] ), 0, [ag]![0_375L] ) AS 0_375L,
IIf( IsNull( [ag]![0_75L] ), 0, [ag]![0_75L] ) AS 0_75L,
IIf( IsNull( [ag]![1_0L] ), 0, [ag]![1_0L] ) AS 1_0L,
IIf( IsNull( [ag]![1_75L] ), 0, [ag]![1_75L] ) AS 1_75L,
IIf( IsNull( [ag]![Total PODs] ), 0, [ag]![Total PODs] ) AS [Total PODs],
[fu].Std,
IIf( IsNull( [ag]![Reporting Agg Brand]), "N", IIf( [ag]![Total PODs] >= [fu]![Std], "Y", "N" ) ) AS [Meets Std?]
FROM
[A00c OFF PREMISE Reporting Agg Brands by FULL UNIVERSE Outlet] as fu
LEFT JOIN
[A01e OFF PREM Outlet Std Status by Agg Brand] as ag
ON
(
[fu].[Outlet State] = [ag].[Outlet State]
)
AND
(
[fu].Sector = [ag].Sector
)
AND
(
[fu].[Reporting Agg Brand] = [ag].[Reporting Agg Brand]
)
AND
(
[fu].[NRI Segmentation Desc] = [ag].[NRI Segmentation Desc]
)
AND
(
[fu].[Spirits Segmentation Sector] = [ag].[Spirits Segmentation Sector]
)
AND
(
[fu].[Customer Group ID] = [ag].[Customer Group ID]
)
AND
(
[fu].[Outlet Name and Code CODE] = [ag].[Outlet Name and Code CODE]
)
;