Current SQL Statement:
SELECT IssuesDB.ID, IssuesDB.User, IssuesDB.Date, IssuesDB.Status, IssuesDB.Resolution
FROM IssuesDB
WHERE (((IssuesDB.ID) Like "*" & [forms]![EndUser Search]![Ticket#] & "*") AND ((IssuesDB.User) Like "*" & [forms]![EndUser Search]![User] & "*")) OR (((IssuesDB.ID) Like "*" & [forms]![EndUser Search]![User] & "*") AND ((IssuesDB.User) Like "*" & [forms]![EndUser Search]![Ticket#] & "*"));
Goal: I created a search form in a ticket system database. I have two ways of searching for a ticket: First is by the ticket number but if the user doesn't have that number they can also search by their Username. If I enter the Ticket number using the current SQL statement it works beautifully. If I enter the username it's returning all users since name all share letters example. If in the drop down menu I select the name Bob Green. I'll get results for Bob Green, Tom Bean, Rob Tree since they all share the letter O, E, and so on. I want the names to only be an exact match.
I tried this SQL Statement also but with this it requires the Ticket number AND Username to be an identical match. I want one or the other, not both.
SELECT IssuesDB.ID, IssuesDB.User, IssuesDB.Date, IssuesDB.Status, IssuesDB.ResolutionFROM IssuesDB
WHERE (((IssuesDB.ID)=[Forms]![EndUser Search]![Ticket#]) AND ((IssuesDB.User)=[Forms]![EndUser Search]![User]));
Any and all help would be greatly appreciated!