Using Null in WHERE is not working ! 
Author Message
 Using Null in WHERE is not working !

Ok guys and gals, it's 2 in the morning, and my brain is already fried.

This makes a recordset with 45 records from a total of 314 :

rcaja5.Open "SELECT * FROM Cajas ORDER BY Nombre", , , ,adcmdText
rcaja5.Filter = "Tin1=Null"

But this brings up 0 records:

rcaja5.Open "SELECT * FROM Cajas WHERE Tin1 = Null ORDER BY Nombre", , ,
,adcmdText

So, what gives?
--
Saludos, Jorge Jimenez, SICAD S.A., Costa Rica
(remove the obvious to send e-mail)



Sat, 17 Jul 2004 16:13:16 GMT  
 Using Null in WHERE is not working !
Jorge

In SQL statement, I think you have to use NULL  (all caps) and not Null.

HTH
Sukesh



Sat, 17 Jul 2004 16:36:25 GMT  
 Using Null in WHERE is not working !

I think the correct syntax is :

rcaja5.Open "SELECT * FROM Cajas WHERE Tin1 is Null ORDER BY Nombre"

Claude



Sat, 17 Jul 2004 16:57:04 GMT  
 Using Null in WHERE is not working !
Hi,

Inside SQL statement you cannot use = NULL. You have to
use IS NULL

SELECT * FROM Cajas WHERE Tin1 IS Null ORDER BY Nombre

Val

Quote:
>-----Original Message-----
>Ok guys and gals, it's 2 in the morning, and my brain is
already fried.

>This makes a recordset with 45 records from a total of
314 :

>rcaja5.Open "SELECT * FROM Cajas ORDER BY

Nombre", , , ,adcmdText
Quote:
>rcaja5.Filter = "Tin1=Null"

>But this brings up 0 records:

>rcaja5.Open "SELECT * FROM Cajas WHERE Tin1 = Null ORDER
BY Nombre", , ,
>,adcmdText

>So, what gives?
>--
>Saludos, Jorge Jimenez, SICAD S.A., Costa Rica
>(remove the obvious to send e-mail)

>.



Sat, 17 Jul 2004 20:53:28 GMT  
 Using Null in WHERE is not working !
Yes, you can. See "SET ANSI_NULLS" in BOL. May be it is not portable, but
this is up to the one is programming.

AMB


Quote:
> Hi,

> Inside SQL statement you cannot use = NULL. You have to
> use IS NULL

> SELECT * FROM Cajas WHERE Tin1 IS Null ORDER BY Nombre

> Val

> >-----Original Message-----
> >Ok guys and gals, it's 2 in the morning, and my brain is
> already fried.

> >This makes a recordset with 45 records from a total of
> 314 :

> >rcaja5.Open "SELECT * FROM Cajas ORDER BY
> Nombre", , , ,adcmdText
> >rcaja5.Filter = "Tin1=Null"

> >But this brings up 0 records:

> >rcaja5.Open "SELECT * FROM Cajas WHERE Tin1 = Null ORDER
> BY Nombre", , ,
> >,adcmdText

> >So, what gives?
> >--
> >Saludos, Jorge Jimenez, SICAD S.A., Costa Rica
> >(remove the obvious to send e-mail)

> >.



Sat, 17 Jul 2004 21:33:12 GMT  
 Using Null in WHERE is not working !
Thanks to all. !
I got it to work about 20 minutes after sending this message
And yes, I usually use IS and IS NOT when using Null
but this time I don't know what got into ADO and it
was not working. So I remembered using the "="
sign sometime ago without any problem but
again, this time ADO had a fit.
Well, I re-wrote it about a million times and finally
got it to work.

So, this is what happens when you commit to an
impossible deadline: brain dead at 3:00 a.m.
--
Thanks again guys and gals ! Love you all!

Saludos, Jorge Jimenez, SICAD S.A., Costa Rica


Quote:
> Hi,

> Inside SQL statement you cannot use = NULL. You have to
> use IS NULL

> SELECT * FROM Cajas WHERE Tin1 IS Null ORDER BY Nombre

> Val

> >-----Original Message-----
> >Ok guys and gals, it's 2 in the morning, and my brain is
> already fried.

> >This makes a recordset with 45 records from a total of
> 314 :

> >rcaja5.Open "SELECT * FROM Cajas ORDER BY
> Nombre", , , ,adcmdText
> >rcaja5.Filter = "Tin1=Null"

> >But this brings up 0 records:

> >rcaja5.Open "SELECT * FROM Cajas WHERE Tin1 = Null ORDER
> BY Nombre", , ,
> >,adcmdText

> >So, what gives?
> >--
> >Saludos, Jorge Jimenez, SICAD S.A., Costa Rica
> >(remove the obvious to send e-mail)

> >.



Sun, 18 Jul 2004 10:37:32 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Null = Null Not Working ?

2. I am trying to update a record, i am not using data control

3. I am trying to update a record, i am not using data control

4. shared variable not working what am I missing?

5. ScaleHeight/ScaleWidth with borderless form - Not working, please help I am stumped

6. Hi, I am having trouble with bar code font not working

7. Alter Table with NULL/NOT NULL options

8. null not null

9. When is Null not Null

10. To Null, or not to Null...?

11. To Null, or not to Null...?

12. Null Values - WHY am I getting this error?

 

 
Powered by phpBB® Forum Software