Quick Question

Alright I just want to know how many days after sex can you take a pregnancy test to get an accurate result? I keep reading after you miss your period or when you're supposed to get your period but I'm so irregular that they come randomly or I completely skip a month and so forth. But I just want to know how many days to get a pretty clear correct answer. Thanks xx!!!