I just want to know how to create SQL syntax in MS access.
What I want to do is I am going to select the from the table which name is Employee, where the fieldname (position) is equal to Manager, Supervisor, Acting Supervisor, and the fieldname (status) is equal to active.
My code found below does not work:
SQL = "SELECT * FROM `Employee` WHERE `position`= '" + "Manager" + "' OR `position`= '" + "Supervisor" + "' OR `position`= '" + "Acting Supervisor WHERE `status`= '" +"ACTIVE"'";
Thanks.
You don’t really need all that string concatenation, you’re missing a quote after
Acting Supervsior, and you can’t have theWHEREkeyword twice – useANDinstead.Update
You could also simplify the logic a bit by using the
INkeyword: