I've got two tables I'm trying to find the records in tbl_A that are not in tbl_B.
FROM tbl_A LEFT JOIN tbl_B
ON tbl_A.Entity_ID = tbl_B.Entity_ID AND tbl_A.docDate = tbl_B.docDate
WHERE tbl_B.tbl_ID IS NULL
But when I try to append these records from A to B, I get an error about violating a unique index on these two fields. When I looked, I found that the docDate field in tbl_A is DateTime2 (0) and the docDate field in tbl_B is DateTime, so apparently the value:
2013-05-08 00:00:00 <> 2013-05-08 00:00:00.000
How can I rewrite this join (I assume a Convert or Cast will be involved) so that the data comparisons will only be to the date level (all of these values have 00:00:00 as the time)?