Okay, so I set up another query that just returns the chains that should return a Null value for CasesPerMonthPerStore, but are actually returning #Error in my test database:
SELECT Chains.Chain
FROM Chains LEFT JOIN ChainsNumStoresPreviousMonthRange ON Chains.Chain = ChainsNumStoresPreviousMonthRange.Chain
WHERE ChainsNumStoresPreviousMonthRange.NumberOfStores Is Null;
So in my written example in the question above this query would return:
Chain
Agricultural Export
Bob's Markets
I then UNION these chains, along with a Null field, to the query that returns all of the chains that do return a value for CasesPerMonthPerStore:
SELECT *
FROM (SELECT ChainsCasesPerMonthPerStorePreviousMonthRange.Chain, ChainsCasesPerMonthPerStorePreviousMonthRange.CasesPerMonthPerStore
FROM ChainsCasesPerMonthPerStorePreviousMonthRange
UNION ALL
SELECT ChainsNotInPreviousPeriod.Chain, NULL
FROM ChainsNotInPreviousPeriod) AS UnionQuery
ORDER BY Chain;
So the secret seems to be to separate the calculated field away from the left join. It's the first time I've come across this error, and I don't know whether this approach would work in every situation, but it worked for me. :)
Thanks for your time Brian & Gord,