If, apart from nominative and accusative, numeral and substantive must go in the same case
shouldn't be
c 1999 (лет) по 2002 (годам)?.
Unless we understand
с годы 1999 по 2002 ?
However "с 1999 по 2002 годы" is what I see in an exercise.
Thank you.