Re: SQL statement

Tech-Archive recommends: Fix windows errors by optimizing your registry



The % goes last. As you wrote it, it will return any records with "i"
somewhere in them not just those that start with "i".

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

On Wed, 10 Aug 2005 14:32:38 -0500, "clintonG"
<csgallagher@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>SELECT * FROM tblCompany WHERE CompanyName LIKE '%" & strSearch & "'"
>
>Download SQL Server Books Online [1].
>
><%= Clinton Gallagher
> METROmilwaukee (sm) "A Regional Information Service"
> NET csgallagher AT metromilwaukee.com
> URL http://metromilwaukee.com/
> URL http://clintongallagher.metromilwaukee.com/
>
>[1] http://www.microsoft.com/sql/techinfo/productdoc/2000/books.mspx
>
>
>"L" <L@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>news:C7F60C0C-9B80-48B2-BD3C-FA95F2EEC17C@xxxxxxxxxxxxxxxx
>>I would like to incorporate a serach page on my web site. I would like
>> for the user to be able to search on a company name and list all the
>> companys that start with "i" if the user types in "i". I know that I need
>> to add a wildcard character but unsure of the syntax.
>> Here's the code below:
>> strsql= "SELECT * FROM tblCompany where CompanyName LIKE '"&strSearch&"'"
>>
>> Thanks.
>>
>

.



Relevant Pages

  • Re: How to display records according to this rule?
    ... Where can I find MS SQL Server Books Online? ... Is there any disadvantage of enabling a database to Full-Text Search? ... > See the topics related to full-text querying in MS SQL Server Books ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Installing SQL Server 2005 on a PC that has Visual Studio 2008
    ... Rick Byham, SQL Server Books Online ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.sqlserver.clients)
  • Re: sp_password
    ... You can find the syntax for xp_cmdshell in SQL Server Books Online or at ... Technical Writer, SQL Server Books Online ... "Leon Parker" wrote in message ...
    (microsoft.public.sqlserver.security)
  • Re: Retrieving field properties
    ... > table are stored in a system table called sysproperties, ... > documented in SQL Server Books Online. ... > If you are looking for a documented method, you can use a system function ...
    (microsoft.public.sqlserver.programming)