Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Problem with where datecolumn = Null

Author  Topic 

reddymade
Posting Yak Master

165 Posts

Posted - 2006-02-10 : 14:36:36
I have the following query: where completedate = NULL, is giving the problem it does'nt get the data:
Can you please tell me what can use other than NULL. for CompleteDate in where condition.


Select actionid, 'ACT' as Type, actiondescription, ModuleName,ModuleRecordID,
[days] = CASE WHEN duedate < GetDate()
THEN '(' + CONVERT(varchar(20), DATEDIFF(Day, duedate, GetDate()))
+ ')'
ELSE CONVERT(varchar(20), DATEDIFF(Day, GetDate(), duedate))
END
FROM Tab_CCSNETACTIONS where AssignedTo = 2 and CompleteDate =NULL


Thank you very much for the information.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-02-10 : 14:38:39
WHERE CompleteDate IS NULL

Tara Kizer
aka tduggan
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-02-10 : 14:58:31
See...proble is, null is not equal to anything....even itself...it needs to be a true/false test



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page
   

- Advertisement -