The answer's always going to be the same. The two queries generate different execution plans (because one only needs to test for the existence of rows and one need to find non-null
EMargin
values). In turn, in one of the plans, a predicate is being pushed "deeper" than in the other, and so a comparison between a datetime and a string value is occurring
earlier than some "guard" predicate that prevents inappropriate comparisons from occurring (when the string doesn't contain something date-like) —
Damien_The_Unbeliever 31 mins ago