I have a Access front-end to a MySQL database over the internet.
I use a report system that allows users to define some custom query parameters.
These are Jet queries because of the need to allowing filtering like this. I have not been able to get this to work by using a Pass-Through query, which appears to need to be set.
SelQ_ChapterMailingList is the Jet query, is the recordsource of the report opening and the above is actually defined in a table and filters a report.
The query and the above run very quickly. However, the following does not:
Suddenly, I go from a couple seconds to a couple of minutes!
Again, SelQ_ChapterMailingList is the reports recordsource, and I set the above to the Access FilterName property of the OpenReport command.
IF I REMOVE THE LEFT AND RIGHT JOINS FROM SELQ_CHAPTERMAILINGLIST, IT WORKS QUICKLY AGAIN (see bottom for that query).
Is there a better way to accomplish this with MySQL?
Thanks. Sean.
SelQ_ChapterMailing List looks like:
I use a report system that allows users to define some custom query parameters.
These are Jet queries because of the need to allowing filtering like this. I have not been able to get this to work by using a Pass-Through query, which appears to need to be set.
Code:
SELECT * FROM SelQ_ChapterMailingList
SelQ_ChapterMailingList is the Jet query, is the recordsource of the report opening and the above is actually defined in a table and filters a report.
The query and the above run very quickly. However, the following does not:
Code:
SELECT * FROM SelQ_ChapterMailingList WHERE (((StatusID)=1) AND ((EmailPreferred)=False))
Suddenly, I go from a couple seconds to a couple of minutes!
Again, SelQ_ChapterMailingList is the reports recordsource, and I set the above to the Access FilterName property of the OpenReport command.
IF I REMOVE THE LEFT AND RIGHT JOINS FROM SELQ_CHAPTERMAILINGLIST, IT WORKS QUICKLY AGAIN (see bottom for that query).
Is there a better way to accomplish this with MySQL?
Thanks. Sean.
SelQ_ChapterMailing List looks like:
Code:
SELECT Tbl_Members.StatusID, Tbl_Members.ChapterNumID, [FirstName] & " " & [MiddleName] & ". " & [LastName] AS MemberName, Tbl_ListDuesYear.DuesYearSimple, Tbl_Members.MemberNr, Tbl_ListMemberType.MemberType, Tbl_Members.[Home-Address], Tbl_Members.[Home-City], Tbl_Members.[Home-State], Tbl_Members.[Home-Zip], Tbl_Members.LastName, Tbl_Members.EmailPreferred
FROM (Tbl_ListMemberType RIGHT JOIN Tbl_Members ON Tbl_ListMemberType.MemberTypeID = Tbl_Members.MemberTypeID) LEFT JOIN Tbl_ListDuesYear ON Tbl_Members.DuesYearID = Tbl_ListDuesYear.DuesYearID
ORDER BY Tbl_Members.LastName;