NOT LIKE taking forever to run

  • Thread starter Thread starter Prav
  • Start date Start date
P

Prav

Hi i'm using Not Like "*TX[0-9]*" in a query and its forever to run. However
if i do Not Like "*TX[0-9]*" its works fine. Any other way to query NOT LIKE.
 
Sorry i mad a mistake i'm using Not Like "*TX[0-9]*" in a query and its
forever to run. However
if i do Like "*TX[0-9]*" its works fine. Any other way to query NOT LIKE.

Prav said:
Hi i'm using Not Like "*TX[0-9]*" in a query and its forever to run. However
if i do Not Like "*TX[0-9]*" its works fine. Any other way to query NOT LIKE.
 
Not Like is notoriously slow in ACCESS.

Assuming that you have a primary key field in the table, this type of query
might run somewhat faster:

Create a query (name it qryLike) and save it:

SELECT PrimaryKeyField
FROM TableName
WHERE FieldName Like "*TX[0-9]*";


Then create this query to show the results you want:

SELECT *
FROM TableName LEFT JOIN
qryLike ON TableName.PrimaryKeyField =
qryLike.PrimaryKeyField
WHERE qryLike.PrimaryKeyField IS NULL;

--

Ken Snell
<MS ACCESS MVP>




Prav said:
Sorry i mad a mistake i'm using Not Like "*TX[0-9]*" in a query and its
forever to run. However
if i do Like "*TX[0-9]*" its works fine. Any other way to query NOT LIKE.

Prav said:
Hi i'm using Not Like "*TX[0-9]*" in a query and its forever to run.
However
if i do Not Like "*TX[0-9]*" its works fine. Any other way to query NOT
LIKE.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Replacing Tables in a Query 3
Queries take FOREVER to run - ??? 3
Query Key 3
TrackMania Nations Forever free on linux 3
Where Not Exists 9
Access Property sheet takes forever to load 3
Windows 7 Problem with Facebook 9
Custom sort order 2

Back
Top