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)
 Select question

Author  Topic 

Rauken
Posting Yak Master

108 Posts

Posted - 2005-04-08 : 08:23:32
My client has a database with a table, [order] with a field of datetime type, delivery_date. If it's not entered it's set to "1900-01-01 00:00:00" by default, Null is not allowed.

I need help with a simple select statement. I want all the fields from [order] select * from [order] but I want blank values for delivery_date if it contains the 1900.. value.


spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-04-08 : 08:30:54
select nullif(delivery_date, '1900-01-01 00:00:00')
from order

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Rauken
Posting Yak Master

108 Posts

Posted - 2005-04-08 : 09:04:51
Thanks, saved my day! Now it's time for Friday afternoon beer.
Go to Top of Page
   

- Advertisement -