In an Aceess 2000 data base, I have two tables, CUSTOMER and tblMonthsOccBrackets. Table CUSTOMERcontains customer daata, including the number of months that each customer occupied a rental unit. Table tblMonthsOccBracketscontains ranges of months (brackets) into which I wish to group the data. My query (not quite finished) looks like this (formatted for readability):
Access reports an error in the first join, highlighting the word ON itself.
This is my first foray in years into unequal inner joins. What am I overlooking?
Code:
SELECT Count() AS Expr1,
CUSTOMER.[Property ID],
[Property Master].Name,
CUSTOMER.[Unit Type Code],
CUSTOMER.[Months Occupied]
FROM [Property Master]
INNER JOIN (tblMonthsOccBrackets
INNER JOIN (CUSTOMER
ON CUSTOMER.[Months Occupied] BETWEEN tblMonthsOccBrackets.intMonthsOccLower
AND tblMonthsOccBrackets.intMonthsOccUpper)
ON [Property Master].[Property ID] = CUSTOMER.[Property ID])
WHERE (((IsNull([Unit Type Code]))=False))
GROUP BY CUSTOMER.[Property ID],
[Property Master].Name,
CUSTOMER.[Unit Type Code],
CUSTOMER.[Months Occupied]
;
Access reports an error in the first join, highlighting the word ON itself.
This is my first foray in years into unequal inner joins. What am I overlooking?