PC Review


Reply
Thread Tools Rate Thread

I am Going CRAZY

 
 
rm
Guest
Posts: n/a
 
      15th Jul 2011
What on earth am I missing!!

SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep NOT IN (NULL, SPACE(0),
"Y");
SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep <> "Y";
SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep NOT IN (NULL, "Y");

0 Records Returned:

SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep = C;
1 Record Returned
M P Keep
8 X C

--------------------------------
Table T
--------------------------------
P M Keep
--------------------------------
A 1 Y
A 3
A 4
B 7 Y
B 9
B 6
C 2
H 5 Y
X 8 C
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      15th Jul 2011
On Fri, 15 Jul 2011 05:44:21 -0700 (PDT), rm <(E-Mail Removed)> wrote:

>What on earth am I missing!!
>
>SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep NOT IN (NULL, SPACE(0),
>"Y");
>SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep <> "Y";
>SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep NOT IN (NULL, "Y");
>
>0 Records Returned:
>
>SELECT T.M, T.P, T.Keep FROM T WHERE T.Keep = C;
>1 Record Returned
>M P Keep
>8 X C
>
>--------------------------------
>Table T
>--------------------------------
>P M Keep
>--------------------------------
>A 1 Y
>A 3
>A 4
>B 7 Y
>B 9
>B 6
>C 2
>H 5 Y
>X 8 C


NULL is a funny beast. Nothing is equal to NULL; nothing is UNEQUAL to Null;
any IN clause containing NULL will fail. The only criteria that work to test
the nullity of a field are IS NULL and IS NOT NULL.

Try

SELECT T.M, T.P, T.KEEP
FROM T
WHERE T.Keep IS NOT NULL
AND T.Keep NOT IN("", "Y");

The test for "" is only necessary if you have overridden the default of Allow
Zero Length Strings = No on the table properties of the field.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NF325-A7 Sound problem: sounds like an echo ,,echo...echo makes me crazy...crazy...crazy...help...help...help David Sontag DIY PC 17 30th Nov 2007 06:45 AM
Help Please Going Crazy =?Utf-8?B?YWpuaXR0aQ==?= Windows Vista Mail 7 14th Feb 2007 03:35 PM
crazy browser crazy dr greg Freeware 2 16th Jan 2005 12:09 AM
This is so crazy Al. Ozzie Windows XP New Users 2 17th Dec 2004 01:59 AM
messengers going crazy - it doesnt reember any changes i make - and its making ME go crazy now =?Utf-8?B?c2FyYWg=?= Windows XP Messenger 0 15th Feb 2004 05:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:34 AM.