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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RE: ASP and SQL Error - expected end of statement

Status
Not open for further replies.

vistor

Technical User
Dec 22, 2000
164
US
Durug,

Sorry I forgot to ask this earlier. Would I add a LIKE to the query as follows:
Original:
sqlQ = sqlQ & " WHERE Employee.last_name = '" & Request("txtlast_name") & "'"

Change to:
sqlQ = sqlQ & " WHERE Employee.last_name = LIKE "*" & '" & Request("txtlast_name") & "'"

CDWD
 

sqlQ = sqlQ & " WHERE Employee.last_name LIKE "'%" & Request("txtlast_name") & "%'"

will return

Ana
Aspen
Armenica
Penta

if request("txtlast_name") = n

if you wnat to return only
Ana
Aspen
Armenica
when request("txtlast_name") = a
then you should delete the first "%" sign

Hope it helps,
Regards,
Durug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top