SELECT * FROM (
Select
TR.Serial_Number,
'Pass' as 'DecayResults',
MAX(TR.Date_Time) as 'DecayDate'
FROM
dbo.Test_Results TR
WHERE
(TR.Date_Time BETWEEN '2013-12-18 00:03:44.890' AND '2013-12-20 00:03:44.890')
AND (ISNULL(TR.Serial_Number,'')<>'') AND LEN(TR.Serial_Number) > = 14
AND (TR.System_ID LIKE '%Decay%')
AND TR.Test_Result LIKE '%PASS%'
GROUP BY 1,2 ) passed
UNION ALL
SELECT * FROM (
Select
TR.Serial_Number,
' ' as 'DecayResults',
MAX(TR.Date_Time) as 'DecayDate'
FROM
dbo.Test_Results TR
WHERE
(TR.Date_Time BETWEEN '2013-12-18 00:03:44.890' AND '2013-12-20 00:03:44.890')
AND (ISNULL(TR.Serial_Number,'')<>'') AND LEN(TR.Serial_Number) > = 14
AND (TR.System_ID LIKE '%Decay%')
AND TR.Test_Result NOT LIKE '%PASS%'
AND TR.Serial_Number NOT IN (
Select TR.Serial_Number
FROM dbo.Test_Results TR
WHERE (TR.Date_Time BETWEEN '2013-12-18 00:03:44.890' AND '2013-12-20 00:03:44.890')
AND (ISNULL(TR.Serial_Number,'')<>'') AND LEN(TR.Serial_Number) > = 14
AND (TR.System_ID LIKE '%Decay%')
AND TR.Test_Result LIKE '%PASS%'
)
Group By 1,2 ) notpassed
... which makes the query much more complex and some additional refactoring would be a plus probably.
Okay, but when there are duplicates, you'll need to spell out for us what logic you want as far as which row to return.
For example, the below has now Passes, but three dates. Which date to pick?
C037743 1010 13 2013-12-19 00:17:02.610
C037743 1010 13 2013-12-19 00:20:36.140
C037743 1010 13 2013-12-19 00:23:26.483