I have a SQL query question.
I need to create a query for Search purpose. I have a table named Empl, it's an Employee table, it has Empl_LN, Empl_FN, Empl_Add, I want like to have an alias name for Emloyee name, and I would like to use the Employee name for LIKE operator to search. I know I have to create a subquey for the Employee name because if I just create in the main query, the Employee name is an alias name but it doesn't have the table name in the query.
Here is my query:
SELECT EmplNo, Empl_LN, Empl_FN,
(SELECT Empl_LN + ', ' + Empl_FN AS EmployeeName
WHERE EmployeeName LIKE ?
Order By Empl_LN
It gave me an error message. I couldn't figure it out. any help will be very appreciated!