for all dividend stock, there is a record date and a payment date.
you must have a settled position on the record date. lets say the record date for BP was 12-01-09 and payment date is 12-29-09
you would have to buy the stock on 11-26-09, settles in t+3 and if you sell the position on 12-02-09, you still get paid on 12-29!