Re: Using Wildcards

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hmm... SQL server is converting my query to single quotes, but this still
does not work. It is picking up every record, even if (storage) is
contained within the field being tested, so it appears that the WILDCARD (*)
characters are being taken literally. How do I test the condition WHERE
fieldA (DOES NOT CONTAIN TEXT) "storage"? So records containing "MY
storage", "storageBinC", and "sqlstoragetest" in fieldA would all be
filtered out.

In plain Access it is simple, please see my query example below. How do I
do it in .adp (SQL server)?

Thanks.

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:%23oQbnO3PFHA.3716@xxxxxxxxxxxxxxxxxxxxxxx
> On SQL-Server, you must generally use single quote ' instead of double
> quotes " to delimit your char strings. There is an option to override
> this but obviously, it's probably not set up in your current
> configuration. Same thing for the dates: use ' instead of # .
>
> The N before the ' is for Unicode.
>
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
>
>
> "Ryan Langton" <langton@xxxxxxxxxxxxxxxxxx> wrote in message
> news:ue8RgT2PFHA.1172@xxxxxxxxxxxxxxxxxxxxxxx
>>I recently converted a database from an .mdb to .adp and am having
>>problems with my queries that use wildcards. Here is an example query in
>>my old database:
>>
>> SELECT *
>> FROM tblUnitDescription
>> WHERE (Issued_To NOT LIKE "*storage*");
>>
>> In the .adp, this does not work. I get an error that "*storage*" is an
>> invalid column. When I try to edit in Design View, my Criteria field is
>> changed by access to:
>>
>> NOT LIKE N'[*storage*]'
>>
>> This, however, generates the same error.
>> Any suggestions appreciated.
>> Thanks.
>>
>
>


.



Relevant Pages

  • Re: Using Wildcards
    ... SQL server is converting my query to single quotes, ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Help with Converting Access query to SQL Stored procedure Please!
    ... I am converting an access database to SQL server and editing the active ... this type of query. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Need help with string value please
    ... OK, well if you feel like pursuing this, you'll have to describe what you expect and what you're actually getting back from the server when you run this query. ... "Expert SQL Server 2008 Encryption" ... "Michael Coles" wrote: ... I replaced your double quotes " with two single quotes ...
    (microsoft.public.sqlserver.programming)
  • Re: LIKE parsing error in Query Analyzer
    ... Change your double quotes to single quotes. ... Columnist, SQL Server Professional ... "Bob Van Coppenolle" wrote in message ... I get an "invalid column name '%%'" error message and the query is ...
    (microsoft.public.sqlserver.server)
  • Re: sql query with an in it
    ... Convert all single quotes with your strName string to two single quotes. ... Columnist, SQL Server Professional ... The query looks ...
    (microsoft.public.vb.database.ado)