Optimised Calendar query
Fixed issue where the export query would fail with a search on a related object