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
 Transact-SQL (2000)
 Excluding null dates RESOLVED

Author  Topic 

Pinto
Aged Yak Warrior

590 Posts

Posted - 2005-04-19 : 05:00:19
I want to select all records with Area = 'South' and where Completed_time is null and Cancelled is null. However, I get an error on the Completed_time is null and Cancelled is null bit. Both these fields are datetime fields in sqlserver table. What syntax should I be using ?
I am using the selection in Crystal reports - if that makes a difference....

TIA

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-04-19 : 05:37:36
Try this

Select * from yourTable where Area = 'South' and Completed_time is null and Cancelled is null

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Pinto
Aged Yak Warrior

590 Posts

Posted - 2005-04-19 : 09:44:34
It should have been IsNull(Completed_time)
Go to Top of Page

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2005-04-20 : 08:16:04
Not in T-SQL - the ISNULL function requires two arguments.

Mark
Go to Top of Page
   

- Advertisement -