$consulta3 = "SELECT * FROM Dept INNER JOIN Userinfo INNER JOIN Checkinout
on Dept.DeptName = '$departamento'
where Dept.Deptid = Userinfo.Deptid AND Userinfo.Name = Checkinout.name";
the thing im trying to do with this query is: i have a table called Dept where it has all the deparments names and ids, User info that has user name, a department id and a id. Also i have a 3rd table called checkinout that has user id, with a time.
So i want (using the deparment's name) to bring all the data from the Checkinout table from the people that belongs to that deparment, but when i try that query it gives me an error:
syntax error in from clause. sql state 37000 in sqlexecdirect
and i cant solve it. Im using a Acces Data base.
Thank you very much for you help.