您好我是 SQL Server 2008 的新手,当我在 SQL Server 中执行以下查询时,它不显示源表中的数据。我相信可以优化以下查询以正确获取数据。如果有人帮助我做到这一点,我将非常感谢他们。
SELECT *
FROM Report
WHERE ( ( Create_Date BETWEEN '10/10/2013 16:00:00' AND '10/16/2013 15:59:59' )
OR ( Date_Resolved BETWEEN '10/10/2013 16:00:00' AND '10/16/2013 15:59:59' )
OR ( ( ( Create_Date < '10/10/2013 16:00:00' )
AND ( Date_Resolved > '10/10/2013 16:00:00' ) )
OR ( ( Create_Date < '10/10/2013 16:00:00' )
AND ( IsDate(Date_Resolved) IS NULL ) ) )
OR ( ( ( Create_Date < '10/16/2013 15:59:59' )
AND ( Date_Resolved > '10/16/2013 15:59:59' ) )
OR ( ( Create_Date < '10/16/2013 15:59:59' )
AND ( IsDate(Date_Resolved) IS NULL ) ) ) )