How soon can I take a pregnancy test

Is 2 weeks after having sex too early ?