I currently have this WHERE
clause that includes the following parameters.
WHERE
Project ID=110
AND ((CAST(saa.Date AS DATE) >= '09/24/2014' AND CAST(saa.Date AS DATE) <= '09/24/2014') OR saa.Date IS NULL))
The tricky part here is that the saa.Date is NULL
section is going to pull up ALL Null
Values in all dates (which is excessive) I only want to use the following Date Range for the Null
Values
(
(CAST(sa.StartDateTime AS DATE) >= '09/24/2014' AND CAST(sa.StartDateTime AS DATE) <= '09/24/2014')
OR
(CAST(sa.EndDateTime AS DATE) >= '09/24/2014' AND CAST(sa.EndDateTime AS DATE) <= '09/24/2014')
)
So I'm trying to figure out how I can create a CASE
statement that would work that would be something like IF saa.Date is NULL Then [Use Date Range Parameters above]