When to take a test?

How soon after intercourse would a pregnancy test be accurate? Do I have to wait until my missed period, or can I take it sooner?