Pregnancy testing

When is the earliest you can take a pregnancy test and have accurate results??