How long to tell if pregnant?

How many days after having sex will an at home pregnancy test be accurate?