What is the difference between record date and ex-dividend date?

Understand the difference between important stock purchase and reporting dates to ensure correct receipt of investment dividend payments.