Question For: Will_Scarlet7 -- your query you wrote last night for me
Posted on 2005-04-12
Yesterday you wrote this Query for me, and I wanted to talk to you about it... let me know when you get here!
Comment from will_scarlet7
Date: 04/11/2005 03:08PM PDT
I'm calling it quits for the night...
Here is a query that you might find useful in building your ComboBox:
SELECT tbl_Users.UserName, tbl_Reports.RptName, IsBitFlagSet([tbl_RptPermissions].[Permissions],[tbl_Reports].[ReportBit]) AS HasPermission, tbl_Reports.PKID
FROM tbl_Reports, tbl_RptPermissions INNER JOIN tbl_Users ON tbl_RptPermissions.UserID = tbl_Users.PKID
ORDER BY tbl_Users.UserName;
It uses a InnerJoin to link the tbl_Users and tbl_RptPermissions, and then a Cartesian join to link in th tbl_Reports, it then calls the "IsBitFlagSet" that I posted above to calculate a true or false field for each person and each report.
Have a good night!