He started working with the Latvia national team in 2001 as assistant to Aleksandrs Starkovs. He was assistant manager when Latvia qualified for and played in Euro 2004, held in Portugal. When Starkovs moved to Russia in 2004 with Spartak Moscow he also gave up his post as Latvia manager on 17 November and Andrejevs was promoted in his place by the Latvian Football Federation Latvia lost the first match with him in charge to Oman, 3–2, in Bahrain. However, Andrejevs had used the match to give fringe squad players a chance to play. Latvia won the King's Cup in Thailand in 2005. He resigned as Latvia manager following a 1–0 defeat on 28 March 2007 to Liechtenstein in a Euro 2008 qualifying match. It was only Liechtensteins second ever win in the competition