Lost???

So when can you actually take a prego test I heard some people say 2 to 3 weeks after sex then some say until you miss your period ??😡confused