Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Query "LIKE" problem


Message #1 by "Normand Laurin" <nlaurin@f...> on Wed, 14 Feb 2001 13:51:19 -0600
The wild card in SQL Server is the percent (%) but in Access it is the splat 
(*). I think SQL Server is like 1992 SQL Compliant and Access is like 1989 
compliant.


>From: "Neale, Chris" <chris.neale@t...>
>Reply-To: "sql language" <sql_language@p...>
>To: "sql language" <sql_language@p...>
>Subject: [sql_language] Re: Query "LIKE" problem
>Date: Thu, 15 Feb 2001 09:34:47 -0000
>
>I could have sworn the '*' wildcard in SQL was '%'..
>
>Chris
>
> > -----Original Message-----
> > From: Wally Burfine [mailto:oopconsultant@h...]
> > Sent: 15 February 2001 06:01
> > To: sql language
> > Subject: [sql_language] Re: Query "LIKE" problem
> >
> >
> > Try using wild cards in the like:
> >
> > itemCategory83 = "83*"
> > itemCategory14 = "14-4*"
> >
> > with out the wild cards it only finds the given value and
> > works like the "="
> > operator.
> >
> >
> > >From: "Ken Schaefer" <ken@a...>
> > >Reply-To: "sql language" <sql_language@p...>
> > >To: "sql language" <sql_language@p...>
> > >Subject: [sql_language] Re: Query "LIKE" problem
> > >Date: Thu, 15 Feb 2001 11:01:39 +1100
> > >
> > >Cut and paste your SQL query into Access (New Query, SQL
> > View) and see what
> > >happens then...
> > >
> > >Cheers
> > >Ken
> > >
> > >----- Original Message -----
> > >From: "Normand Laurin" <nlaurin@f...>
> > >To: "sql language" <sql_language@p...>
> > >Sent: Thursday, February 15, 2001 6:51 AM
> > >Subject: [sql_language] Query "LIKE" problem
> > >
> > >
> > >Hi,
> > >
> > >I'm working with an Access 97 db and ASP 2.0, I'm trying to select
> > >all the kitPart that start with "83..."  and the ones that start
> > >with"14-4..."
> > >in a table named orders.
> > >Now it works fine if I query one of them both not both?
> > >My query is as follow:
> > >
> > >Dim strQuery, itemCategory83, itemCategory14, strcookie
> > >
> > >strcookie = Request.Cookies(...
> > >
> > >itemCategory83 = "83"
> > >itemCategory14 = "14-4"
> > >
> > >strQuery = "Select kitPart, qty, totalprice from orders
> > where kitPart like
> > >'" & itemCategory83 & "%' or kitPart like '" &
> > itemCategory14 & "%' and
> > >userCookie_id = '" & strcookie & "'"
> > >
> > >Could someone give me the right syntax for this query?
> > >
> > >
> >
>________________________________________________________________________
>
>TNL (TM) - The Next Level Systems Ltd
>http://www.tnl.co.uk
>

  Return to Index