我正在尝试在CAST()
和datetime
功能上使用NULL
功能。
我的查询是这样的:
where [closed_at] = '' or Cast ([closed_at] as datetime) > = '09-01-2011 00:00'
and [class_name] in ('Job' ,'Education');
答案 0 :(得分:0)
您将使用IS NULL条件
where ([closed_at] is NULL or Cast ([closed_at] as datetime) > = '09-01-2011 00:00') and [class_name] in ('Job' ,'Education');
或
where Cast (ISNULL([closed_at],'09-01-2011 00:00') as datetime) > = '09-01-2011 00:00') and [class_name] in ('Job' ,'Education');