But I have come across a problem where when the user creates a report they want all of there companies users to see the report also. So instead of each user logging in and creating that same report. I have placed a checkbox on the bottom of the save report page that if check will also make available to all users in that company. That works fine. But here is the dilemma, probably real easy but just thinking to hard. I need a SQL statement where it will display the users reports and there companies report, only who is logged in. here is my current SQL
Now I want to add
I need this table to display all of the users reports and anyone else who has save reports to the company. I think I have explained well. If not please ask. Thanks
Code:
SELECT *
FROM SAVEDREPORT
WHERE UsersID = '{UserID}' <-- (Session)
Code:
SELECT *
FROM SAVEDREPORT
WHERE UsersID = '{UserID}' AND CompanyID = ‘{CompanyID}’ AND Company = ‘Yes’ <-- Checkbox on save reports page value.