"Not Like" has stopped working

ojeffery

Registered User.
Local time
Today, 21:48
Joined
Nov 13, 2009
Messages
11
Hi all,

New to the forum and fairly new to Access 2003, please help... "Not Like" is refusing to work in my query - but "Like" works just fine! What would be causing that? I'm trying to filter out any client records from my database that have ZZ in the Client Code. If I filter with Like, it shows me all the ones that do have it in, but if I filter with Not Like, it just shows me all records. What gives? :confused:

Query is below:

Code:
SELECT [Relationships - All Info].Contact1ID, [Relationships - All Info].[Contact 1 Client Info].ClientCode, [Relationships - All Info].[Contact 1 Data].[Contact Name], [Relationships - All Info].Contact2ID, [Relationships - All Info].[Contact 2 Client Info].ClientCode, [Relationships - All Info].[Contact 2 Data].[Contact Name], [Relationships - All Info].RelationshipID, [Relationships - All Info].Twist, [Relationships - All Info].ContactContact
FROM [Relationships - All Info]
WHERE ((([Relationships - All Info].[Contact 1 Client Info].ClientCode) Not Like "%zz%"));
 
Can't believe it was as simple as using the wrong wildcard characters, but apparently it was... *facepalms self* :rolleyes:

Many thanks for your help.
 
The percent sign is used as the wildcard in some VBA expressions.
Not knowing this has caused more grief than not knowing about the *.

Those of us who learnt on PCs when there was only DOS know the * very well.
But the percent was surprise to me. I long believed there was no wildcard in VBA.
 
The % sign is used when dealing with SQL Server. The asterisk (*) when dealing with JET objects.
 

Users who are viewing this thread

Back
Top Bottom