sql server datetime类型字段使用isnull返回1900-01-01 00:00:00.000的问题
若字段定义的类型为datetime,插入为''(空),那么会默认值为1900-01-01 00:00:00.000
解决方法查询的时候过滤下cast(nullif('','') as datetime)
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
select cast('' as datetime) , cast(nullif('','') as datetime) , isnull(cast(nullif('','') as datetime),getdate())