I'm using visual studio 2005 with ASPX + VB and Access.
Can someone help me with this, please. What I want the SQL to do is display all closed audits. The problem is that only certain people are allowed to see certain audits. So I want people to only see closed audits where they have rights. This is done by a PersonID (stored in a session). The only other people who can see closed audits are Admin staff, who have an admin value of 1 (everyone else is 0 - also stored in a session). I can get the audits to come up for people's PersonID's, but how can I get it to produce the audits for people who have admin rights?
Here's my current SQL code:
SELECT audits.ID, audits.QuickNam e, audits.Status, Person.PersonID , Person.Admin FROM ((audits INNER JOIN allowed ON audits.ID = allowed.AuditNu m) INNER JOIN Person ON allowed.PersonI D = Person.PersonID ) WHERE (audits.Status = 'Closed') AND (Person.PersonI D = ?) OR (audits.Status = 'Closed') AND (Person.PersonI D = ?) AND (Person.Admin = 1)
Can someone help me with this, please. What I want the SQL to do is display all closed audits. The problem is that only certain people are allowed to see certain audits. So I want people to only see closed audits where they have rights. This is done by a PersonID (stored in a session). The only other people who can see closed audits are Admin staff, who have an admin value of 1 (everyone else is 0 - also stored in a session). I can get the audits to come up for people's PersonID's, but how can I get it to produce the audits for people who have admin rights?
Here's my current SQL code:
SELECT audits.ID, audits.QuickNam e, audits.Status, Person.PersonID , Person.Admin FROM ((audits INNER JOIN allowed ON audits.ID = allowed.AuditNu m) INNER JOIN Person ON allowed.PersonI D = Person.PersonID ) WHERE (audits.Status = 'Closed') AND (Person.PersonI D = ?) OR (audits.Status = 'Closed') AND (Person.PersonI D = ?) AND (Person.Admin = 1)
Comment