By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,086 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,086 IT Pros & Developers. It's quick & easy.

How to test for a null value in a date column

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.