I fixed it. I took out the count and it runs in 30 seconds. The program did a count on the table everytime it was missing a transaction. If it was missing 500 transactions that was 500 counts. The table gets pretty big. I should have caught that earlier. Thanks for your help.