dwilliscp (5/8/2013) Sean Lange (5/8/2013)
What are the results of these two queries?
select COUNT(*) FROM #Delivery Where cast(delivery as int) = 83535308
select COUNT(*) from details_2 where cast(details_2.Delivery_Doc as int) = 83535308
One (Delivery) and zero (details_2)... that is what makes this so darn strange. If you do an inner join you come up with nothing.
I have found one other strange thing..
The outer join has data in the columns for details_2, so I do not understand how in the heck it is doing the link between the two tables... there shouldn't be anything on the details_2 side.
Based on what you have in result of tqo COUNT queries your posted query of
FROM #Delivery Left Outer JOIN
details_2 ON cast(#Delivery.Delivery as int) = cast(details_2.Delivery_Doc as int) AND
cast(#Delivery.Delivery_Item as int) = cast(details_2.Delivery_Item as int)
Where cast(delivery as int) = 83535308
will return one row only.
So, I guess you posted not exact query you are running (probably you have omitted some things which you might think were insignificant).
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
(So many miracle inventions provided by MS to us...)How to post your question to get the best and quick help