473,473 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Not-operator not working?

Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field in
the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john
Jul 12 '06 #1
11 1693
Does the query pull up records when there is nothing in the criteria
field?

Sarah Schreffler

john wrote:
Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field in
the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john
Jul 12 '06 #2
The query doesn't give me any records while there are some records with
empty values for the criteria field 'Lastname'.
When I don't use the not-criteria in the query it pulls up every record in
the table.
john

"Sarah Schreffler" <sa**************@gmail.comschreef in bericht
news:11********************@s13g2000cwa.googlegrou ps.com...
Does the query pull up records when there is nothing in the criteria
field?

Sarah Schreffler

john wrote:
>Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field
in
the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john

Jul 12 '06 #3
It's hard to say without more details. Can you post the sql that is
generated by this query? (click on SQL view instead of the blue design
triangle).
Possible causes may be that you have some other criterion going on at the
same time and the combination excludes all records, or that you did an inner
join to another table in which there are no matching records, or at least no
matching records that aren't called "johnson".
good luck
"john" <jo**@test.comwrote in message
news:Ls********************@casema.nl...
Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field in
the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john

Jul 12 '06 #4
On Wed, 12 Jul 2006 17:27:05 +0200, john wrote:
Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field in
the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john
That should work if that is the only criteria for the query.
Does <"Johnson" work?
Does using the single quote work, i.e. Not 'Johnson' ?
How about Not Like "Johnson*"
Does "Johnson" (without the Not) bring up just the Johnson records?
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jul 12 '06 #5
For test reasons I made it very basic, a two field table. The query is:

SELECT Test.ID_applicatie, Test.Status
FROM Test
WHERE ((Not (Test.Status)="Vervallen"));

For this message i used 'Johnson' in stead of 'Vervallen'.
john

"John Welch" <john(remove)welch@cal(remove)central.comschreef in bericht
news:e9********@enews4.newsguy.com...
It's hard to say without more details. Can you post the sql that is
generated by this query? (click on SQL view instead of the blue design
triangle).
Possible causes may be that you have some other criterion going on at the
same time and the combination excludes all records, or that you did an
inner join to another table in which there are no matching records, or at
least no matching records that aren't called "johnson".
good luck
"john" <jo**@test.comwrote in message
news:Ls********************@casema.nl...
>Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field
in the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john


Jul 12 '06 #6
Does <"Johnson" work?
No.
Does using the single quote work, i.e. Not 'Johnson' ?
No.
How about Not Like "Johnson*"
Not working either.
Does "Johnson" (without the Not) bring up just the Johnson records?
Yes, that does work

???
john
"fredg" <fg******@example.invalidschreef in bericht
news:zg****************************@40tude.net...
On Wed, 12 Jul 2006 17:27:05 +0200, john wrote:
>Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field
in
the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john

That should work if that is the only criteria for the query.
Does <"Johnson" work?
Does using the single quote work, i.e. Not 'Johnson' ?
How about Not Like "Johnson*"
Does "Johnson" (without the Not) bring up just the Johnson records?
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Jul 12 '06 #7
I'm not sure what went wrong but now the NOT-operator works for records that
have a value for 'Lastname'. I've added 'and null' to pull up the records
with empty values.
Is this the correct way to do?
Thanks again,
john

"john" <jo**@test.comschreef in bericht
news:Ls********************@casema.nl...
Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field in
the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john

Jul 12 '06 #8
* john:
I'm not sure what went wrong but now the NOT-operator works for records that
have a value for 'Lastname'. I've added 'and null' to pull up the records
with empty values.
Is this the correct way to do?
Yes, that's standard SQL.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Jul 12 '06 #9
Thanks all.
john

"Randy Harris" <pl****@send.no.spamschreef in bericht
news:0f*******************@newssvr27.news.prodigy. net...
>* john:
>I'm not sure what went wrong but now the NOT-operator works for records
that have a value for 'Lastname'. I've added 'and null' to pull up the
records with empty values.
Is this the correct way to do?

Yes, that's standard SQL.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

Jul 12 '06 #10
Hi John,

Your Not is a Not(Test.Status) and returns a Boolean, which is never
equal to "Vervallen"

Better use:
WHERE Not (Test.Status = "Vervallen")
or
WHERE (Test.Status <"Vervallen")

This under the condition that Test.Status has a string-value and is not
a Boolean.

Success, HBInc.


john wrote:
For test reasons I made it very basic, a two field table. The query is:

SELECT Test.ID_applicatie, Test.Status
FROM Test
WHERE ((Not (Test.Status)="Vervallen"));

For this message i used 'Johnson' in stead of 'Vervallen'.
john

"John Welch" <john(remove)welch@cal(remove)central.comschreef in bericht
news:e9********@enews4.newsguy.com...
It's hard to say without more details. Can you post the sql that is
generated by this query? (click on SQL view instead of the blue design
triangle).
Possible causes may be that you have some other criterion going on at the
same time and the combination excludes all records, or that you did an
inner join to another table in which there are no matching records, or at
least no matching records that aren't called "johnson".
good luck
"john" <jo**@test.comwrote in message
news:Ls********************@casema.nl...
Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria' field
in the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john
Jul 13 '06 #11
bedankt ;-)

"hbinc" <j.********@hccnet.nlschreef in bericht
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi John,

Your Not is a Not(Test.Status) and returns a Boolean, which is never
equal to "Vervallen"

Better use:
WHERE Not (Test.Status = "Vervallen")
or
WHERE (Test.Status <"Vervallen")

This under the condition that Test.Status has a string-value and is not
a Boolean.

Success, HBInc.


john wrote:
>For test reasons I made it very basic, a two field table. The query is:

SELECT Test.ID_applicatie, Test.Status
FROM Test
WHERE ((Not (Test.Status)="Vervallen"));

For this message i used 'Johnson' in stead of 'Vervallen'.
john

"John Welch" <john(remove)welch@cal(remove)central.comschreef in
bericht
news:e9********@enews4.newsguy.com...
It's hard to say without more details. Can you post the sql that is
generated by this query? (click on SQL view instead of the blue design
triangle).
Possible causes may be that you have some other criterion going on at
the
same time and the combination excludes all records, or that you did an
inner join to another table in which there are no matching records, or
at
least no matching records that aren't called "johnson".
good luck
"john" <jo**@test.comwrote in message
news:Ls********************@casema.nl...
Out of a table I'm trying to pull out every record in which the field
'Lastname' is not 'Johnson'.
In order to do this I've put the following next to the 'criteria'
field
in the query-window:
Not "Johnson"
However the resulting table is empty.
Does someone know why it's not working?
Thanks,
john

Jul 14 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon | last post by:
Hi, I am having a little problem with my PHP - MySQl code, I have two tables (shown below) and I am trying populate a template page with data from both. <disclaimer>Now I would like to say my...
5
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
33
by: Bob | last post by:
When I first started in web programming (I left it for more than a few years) I programmed my web pages in C and a little perl. Now that I have a need to come back to web programming I find that...
16
by: Andrea A | last post by:
Hi, i'm developing a website that will have an huge amount of visitors a day --> it will be a contest with 100.000$ of prize. I'm concerning about using a template class (and which one do you...
13
by: Bruce A. Julseth | last post by:
I'm a newbie to PHP and am have problems getting simple PHP page (php_test_page.php) to display correctly. The page is: <html> <body>
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
16
by: Gonçalo Rodrigues | last post by:
Hi, Consider the following class: >>> class Test(object): .... def __init__(self, obj): .... self.__obj = obj .... def __getattr__(self, name): .... return getattr(self.__obj, name)...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
19
by: Karl Scalet | last post by:
Hi, quite often there is a need to just print out the items of a list. that would be nice, except prt() does not exist, and print is a statement not a function, hence cannot replace prt as...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.