I've searched the last 3 nights (lucky me huh!) and I've tested and tested, but, can't get the results I need. Please HELP!!!
What I want to do is search a text field nvarchar(50) from left to right. So, if a user is searching for let's say Targets but only enteres tar this is the result I want:
Tar
Targets
Tarpets
Tarpoops
etc.
I've tried left, substring, like, etc. sometimes I get only the items that begin with "T" (like the above example) except I'll be searching "Tar" and get "tolerance" but that doesnt have Tar in it???
Thanks in advance, please tell me I'm not crazy!
Here's my stored procedure:
@NameSch nvarchar,
@LengthSch integer
AS
SELECT * from supplier_loc
where left(Name,@LengthSch) = @NameSch
order by Name
GO
(Note: the where clause has been changed quite a bit to different things I've been trying, this is just the current version I've been using before posting this).
What I want to do is search a text field nvarchar(50) from left to right. So, if a user is searching for let's say Targets but only enteres tar this is the result I want:
Tar
Targets
Tarpets
Tarpoops
etc.
I've tried left, substring, like, etc. sometimes I get only the items that begin with "T" (like the above example) except I'll be searching "Tar" and get "tolerance" but that doesnt have Tar in it???
Thanks in advance, please tell me I'm not crazy!
Here's my stored procedure:
@NameSch nvarchar,
@LengthSch integer
AS
SELECT * from supplier_loc
where left(Name,@LengthSch) = @NameSch
order by Name
GO
(Note: the where clause has been changed quite a bit to different things I've been trying, this is just the current version I've been using before posting this).