469,080 Members | 1,730 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,080 developers. It's quick & easy.

How to test for a null value in a date column

I am creating the following view

CREATE OR REPLACE VIEW AllMedics AS
SELECT * FROM Medic m, Employee e
WHERE e.EmployeeID = m.MedicID AND
e.DateFinished = NULL;

But all I get is "no rows selected". How do I test a date column to
see if it is null?

NB The DateDinished above means the date that the employee was
fired/resigned.

Any help would be greatly appriciated.

Jagdip Singh Ajimal
Jul 19 '05 #1
5 72695
Ron

"e.DateFinished = NULL" - did you try "e.DateFinished is null"

Regards,

Ron
DBA Infopower
http://www.dbainfopower.com
Standard disclaimer:
http://www.dbainfopower.com/dbaip_ad...isclaimer.html


"Jagdip Singh Ajimal" <js*****@hotmail.com> wrote in message
news:c8**************************@posting.google.c om...
I am creating the following view

CREATE OR REPLACE VIEW AllMedics AS
SELECT * FROM Medic m, Employee e
WHERE e.EmployeeID = m.MedicID AND
e.DateFinished = NULL;

But all I get is "no rows selected". How do I test a date column to
see if it is null?

NB The DateDinished above means the date that the employee was
fired/resigned.

Any help would be greatly appriciated.

Jagdip Singh Ajimal

Jul 19 '05 #2
js*****@hotmail.com (Jagdip Singh Ajimal) wrote in message news:<c8**************************@posting.google. com>...
I am creating the following view

CREATE OR REPLACE VIEW AllMedics AS
SELECT * FROM Medic m, Employee e
WHERE e.EmployeeID = m.MedicID AND
e.DateFinished = NULL;

But all I get is "no rows selected". How do I test a date column to
see if it is null?

NB The DateDinished above means the date that the employee was
fired/resigned.

Any help would be greatly appriciated.

Jagdip Singh Ajimal


e.DateFinished IS NULL;

Dave
Jul 19 '05 #3
js*****@hotmail.com (Jagdip Singh Ajimal) wrote in message news:<c8**************************@posting.google. com>...
I am creating the following view

CREATE OR REPLACE VIEW AllMedics AS
SELECT * FROM Medic m, Employee e
WHERE e.EmployeeID = m.MedicID AND
e.DateFinished = NULL;

But all I get is "no rows selected". How do I test a date column to
see if it is null?

NB The DateDinished above means the date that the employee was
fired/resigned.

Any help would be greatly appriciated.

Jagdip Singh Ajimal

Have you tried "is null" instead of "= null " or "is not null" instead of "<> null"?
Jul 19 '05 #4
Jagdip Singh Ajimal wrote:

I am creating the following view

CREATE OR REPLACE VIEW AllMedics AS
SELECT * FROM Medic m, Employee e
WHERE e.EmployeeID = m.MedicID AND
e.DateFinished = NULL;

But all I get is "no rows selected". How do I test a date column to
see if it is null?

NB The DateDinished above means the date that the employee was
fired/resigned.

Any help would be greatly appriciated.

Jagdip Singh Ajimal


Consider this: what is the definition of 'NULL' and how can anything
'equate' to that 'value'?

You want to use the 'IS NULL', not the '= NULL' construct.

(This is basic SQL - please consider reviewing your/an 'introduction to
SQL' documentation or book. Things like this are not intuitive to the
uninitiated and will lead to frustration.)
/Hans
Jul 19 '05 #5
The solution turned out to be simple. All I did was change the code to
the following:

CREATE OR REPLACE VIEW AllMedics AS
SELECT * FROM Medic m, Employee e
WHERE e.EmployeeID = m.MedicID AND
* e.DateFinished IS NULL;
js*****@hotmail.com (Jagdip Singh Ajimal) wrote in message news:<c8**************************@posting.google. com>...
I am creating the following view

CREATE OR REPLACE VIEW AllMedics AS
SELECT * FROM Medic m, Employee e
WHERE e.EmployeeID = m.MedicID AND
e.DateFinished = NULL;

But all I get is "no rows selected". How do I test a date column to
see if it is null?

NB The DateDinished above means the date that the employee was
fired/resigned.

Any help would be greatly appriciated.

Jagdip Singh Ajimal

Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Bodza Bodza | last post: by
6 posts views Thread by Paulb1us | last post: by
8 posts views Thread by craigkenisston | last post: by
6 posts views Thread by Dean Slindee | last post: by
5 posts views Thread by Jagdip Singh Ajimal | last post: by
reply views Thread by Microsoft Newsserver | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.