34,590
社区成员
发帖
与我相关
我的任务
分享
SELECT *
FROM s_starf
WHERE (s_protype = 40) AND (s_value IS NULL) OR
(s_protype = 40) AND (CAST(s_value AS datetime) < GETDATE())
select * from s_starf
where (s_value <getdate() or isdate(s_value)=0 or s_value is null) and s_protype = 40
select *
from s_starf
where (s_value <getdate() and isdate(s_value)=1) --是日期格式的小于当天
or isdate(s_value)=0 --或者不是日期格式的
or s_value is null --或者为空的
select * from s_starf where s_value <getdate() or isdate(s_value)=0 or s_value is null