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 2005 Forums
 Transact-SQL (2005)
 how would I allow nulls in this?

Author  Topic 

cwfontan
Yak Posting Veteran

87 Posts

Posted - 2008-12-10 : 12:37:43
edit*
Retry my question.. In my table i have 3 columns i want to select the record if all three columns are NULL

ID | d1 | d2 | d3
1 NULL NULL NULL
2 date NULL NULL
3 NULL date NULL
4 NULL NULL NULL

in the above record it would return record 1 & 4


Thanks,
C

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-10 : 15:18:38
WHERE d1 IS NULL AND d2 IS NULL AND d3 IS NULL

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-10 : 20:14:49
Where coalesce (d1,d2,d3) is null.
Go to Top of Page
   

- Advertisement -