|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
using LIKE to query the leftmost characterin an sql statement that is concatenating asp, i want to query first
names to a customer database with LIKE: "SELECT fname + ' ' + fname AS Name, cust_id " _ & "FROM tblcusttag " _ & "WHERE fname LIKE '%" & Left(strSearch,1) ...having trouble usingLeft function, as when the user does the query, they have to correctly have the first letter of the first name right in the customer query. strSearch is the ID of the textbox that they enter the text in. TIA ..netSports You should really use a stored proc. Send across only the first character
of the test string: create proc MyProc ( @char char (1) ) as set nocount on select fname + ' ' + lname as Name , cust_id from tbl_custtag where fname like @char + '%' go -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. ".Net Sports" <ballz2w***@cox.net> wrote in message in an sql statement that is concatenating asp, i want to query firstnews:1115942330.931843.190930@o13g2000cwo.googlegroups.com... names to a customer database with LIKE: "SELECT fname + ' ' + fname AS Name, cust_id " _ & "FROM tblcusttag " _ & "WHERE fname LIKE '%" & Left(strSearch,1) ...having trouble usingLeft function, as when the user does the query, they have to correctly have the first letter of the first name right in the customer query. strSearch is the ID of the textbox that they enter the text in. TIA ..netSports |
|||||||||||||||||||||||