MS Access SQL queary on First and Last Name
Posted on 2011-03-22
I have a query where Supervisors are able to search for an employee on their last name. As expected there are multiple employees with the same last name. Is there a way I can ask the user to input the employee's first name ONLY if there are other employees with the last name that they are searching for? I wasn't sure if there was a way to do this within the query or if I had to write some code where I search through the records.
Here is the query that's currently in place:
SELECT Requests.RequestID, Requests.EmployeeFirstName AS FirstName, Requests.EmployeeLastName AS LastName, Requests.Department, Requests.RequestTypeID, Requests.StartDate, Requests.EndDate, Requests.CreationDate, Requests.Comments, Requests.HoursOfVacation, Requests.SupervisorID, Requests.EmployeeSignature, Requests.SupervisorSignature, Requests.[Approved/Unapproved], Requests.[Request Type], Requests.SupervisorComments, Requests.DateProcessed, Requests.PointsIssued
WHERE ((([Requests].[EmployeeLastName])=[Employee Lookup:]));