how about a like statement? I would like to create an employee phone number search...
I would like to formulate a string as such to execute: http://www.mysite.com?defualt.aspx?tabid=37&sern=Jo
This is what I have so far (connects to another db):
SELECT TOP 100 PERCENT Emp_First_Name + ' ' + Emp_Last_Name AS Name, Office_Phone_1 AS Phone, Office_Email AS Email, Job_Title AS Title,
Department AS Department, Company AS Company
FROM (SELECT DISTINCT
Employee_ID, Company, Location, Department, Emp_First_Name, Emp_Initial, Emp_Last_Name, NickName, Job_Title, Office_Phone_1,
OPhone1_ext, Office_Phone_2, OPhone2_ext, Home_Phone_1, Home_Phone_2, Cell_Phone, Pager_Phone, Person_Fax_Phone,
Dept_Fax_Phone, Office_Email, Home_Email
FROM phonedir_wbi
UNION
SELECT DISTINCT
Employee_id, Company_id, Location_id, department_id, Emp_First_Name, Emp_Initial, Emp_Last_Name, NickName, Job_Title,
Office_Phone_1, OPhone1_ext, Office_Phone_2, OPhone2_ext, Home_Phone_1, Home_Phone_2, Cell_Phone, Pager_Phone,
Person_Fax_Phone, Dept_Fax_Phone, Office_Internet_add, Home_Internet_add
FROM tblEmployee) DERIVEDTBL WHERE
(Emp_Last_Name LIKE '%" & [QUERYSTRING:sern] & "%' OR Emp_First_Name LIKE '%" & [QUERYSTRING:sern] & "%' OR Office_Email LIKE '%" & [QUERYSTRING:sern] & "%' OR Job_Title LIKE '%" & [QUERYSTRING:sern] & "%' OR Department LIKE '%" & [QUERYSTRING:sern] & "%' OR Company LIKE '%" & [QUERYSTRING:sern] & "%' OR Office_Phone_1 LIKE '%" & [QUERYSTRING:sern] & "%')
thanks
midspot