how soon will i test negative

I tested positive for covid on july 31st, hoping to go back to work August 16 i will have to have a negative result, however, i received a doctors note stating that we will be clear on august 7th. I went to get tested august 9th and the results just came back positive still?? i am so confused.