pregnancy test??

can you take a pregnancy test 2 weeks after sex and get an accurate result?