Joining tables on different datetime data types

I've got two tables I'm trying to find the records in tbl_A that are not in tbl_B.

SELECT tbl_A.*
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)?
LVL 50
Dale FyeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Russ SuterCommented:
Yep, you're pretty much right on. This should do it...

SELECT tbl_A.*
FROM tbl_A LEFT JOIN tbl_B
ON tbl_A.Entity_ID = tbl_B.Entity_ID AND CAST(tbl_A.docDate as date) = CAST(tbl_B.docDate as date)
WHERE tbl_B.tbl_ID IS NULL
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeAuthor Commented:
Thanks, worked like a charm.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.