Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching Users Profile query

Status
Not open for further replies.

liorlankril

Programmer
Nov 5, 2005
46
IL
I have a web part that contain SQL Query for serching users profile

string SQL_QUERY="SELECT " +
\"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\", "+
"\"urn:schemas-microsoft-com:sharepoint:portal:profile:LastName\" "+
"FROM " +
"( TABLE Portal_Content..Scope() " + "UNION ALL TABLE Non_Portal_Content..Scope() ) " +
"WHERE " +
"(CONTAINS(\"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\", '\""+val+"*\"')" +
"OR CONTAINS(\"urn:schemas-microsoft-com:sharepoint:portal:profile:LastName\", '\""+val+"*\"')) ";

This Query search user which his FirstName or LastName contain 'val' on the begining - Example if val="ko" it will find "Kobi Brayent" and "Jon Kobiak"

I want to chang the query to find any apperance of val in FirstName or LastName - Examplae if val="bi" or "ye" it will find "Kobi Brayent"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top