• The only things I left out was the listing of columns and the complete name (liked server.database.dbo.table), and the WHERE includes a limit on the #delivery... "Where #Delivery.Load_From = 'Something' ".

    I am not sure why I did not find this yesterday... but when I run the following query today I find two records:

    select *

    from details_2

    where cast(delivery_doc as int) = 83535308

    so now I get to find out why there are two records here .. that look the same.