I'm trying to pull data from my db where the user has taken a test and passed it. However, it may be that the test has a compliance to it, meaning that a user will have to take it, pass it, and then after a year take it again...basically, user is assigned to take the course on 1/1/2005. Course table compliance field says 1 (refers to 1 year compliance) based on the company rules user will be in compliance for a year after they pass the course, so theoritically user does not have to take the course until 12/31/05, can pass it and then be in compliance until 12/31/06...(not my rule, seems odd I know)...anyway I need to report out who is in compliance...so here is my select statement so far:
"SELECT results.username, results.courseid, results.coursename, results.datecompleted, results.passorfail, Courses.compliance
FROM results INNER JOIN Courses ON Courses.courseid = results.courseid
WHERE results.coursename = '$coursename' AND results.passorfail = 'P' "
So that easily gives me those who are passed, but how do I basically add to my where clause datecompleted + compliance (1 year)...this is where I am lost....
thanks