Title: History of Kraków
Content:  Kraków (Cracow) is one of the largest and oldest cities in Poland, with the urban population of 756,441 (2008). Situated on the Vistula river (Wisła) in the Lesser Poland region, the city dates back to the 7th century. It was the capital of Poland from 1038 to 1596, the capital of the Grand Duchy of Kraków from 1846 to 1918, and the capital of Kraków Voivodeship from the 14th century to 1999. It is now the capital of the Lesser Poland Voivodeship.
Title: Kraków
Content:  Kraków, also written in English as Krakow and traditionally known as Cracow, is the second-largest and one of the oldest cities in Poland. Situated on the Vistula River in Lesser Poland Voivodeship, the city dates back to the 7th century. Kraków was the official capital of Poland until 1596 and has traditionally been one of the leading centres of Polish academic, economic, cultural and artistic life. Cited as one of Europe's most beautiful cities, its Old Town was declared the first UNESCO World Heritage Site in the world. The city has grown from a Stone Age settlement to Poland's second-most-important city. It began as 
Title: Kraków Voivodeship (1975–1998)
Content:  The Kraków Voivodeship, from 1975 to 1984 known as the Kraków Metropolitan Voivodeship, was a voivodeship (province) of the Polish People's Republic from 1975 to 1989, and the Republic of Poland from 1989 to 1998. Its territory included its capital, Kraków and the surrounding municipalities. It was established on 1 June 1975, from the part of the Kraków Voivodeship, and the city of Kraków, which until then acted as a separate administrative division. It existed until 31 December 1998, when it got incorporated into then-established Lesser Poland Voivodeship.
Title: Polish–Lithuanian Commonwealth
Content:  date the change of the Polish capital from Kraków to Warsaw between 1595 and 1611, although Warsaw was not officially designated capital until 1793. The Commonwealth Sejm began meeting in Warsaw soon after the Union of Lublin and its rulers generally maintained their courts there, although coronations continued to take place in Kraków. The modern concept of a single capital city was to some extent inapplicable in the feudal and decentralized Commonwealth. Warsaw is described by some historians as the capital of the entire Commonwealth. Wilno, the capital of the Grand Duchy, is sometimes called the second capital of the entity.
Title: Kraków Voivodeship (1945–1975)
Content:  The Kraków Voivodeship was a voivodeship (province) with capital in Kraków, that was located in the southern Lesser Poland. It existed from 1945 to 1975. Until 19 February 1947, it was part of the Republic of Poland, which then was replaced by the Polish People's Republic. It was established on 28 June 1945, from the occupied territories of the General Government. In 1957, the city of Kraków separated from the voivodeship, forming a separate administrative division. ​It ceased to exist on 31 May 1975, when it was partitioned into then-established Kraków Metropolitan, Nowy Sącz, Tarnów, Biała, Katowice, and Kielce Voivodeships.
Title: Kraków
Content:  hamlet on Wawel Hill and was reported as a busy trading centre of Central Europe in 965. With the establishment of new universities and cultural venues at the emergence of the Second Polish Republic in 1918 and throughout the 20th century, Kraków reaffirmed its role as a major national academic and artistic centre. The city has a population of about 780,000, with approximately 8 million additional people living within a 100 km radius of its main square. After the invasion of Poland by Nazi Germany at the start of World War II, the newly defined Distrikt Krakau (Kraków District) became the capital of Germany's 
Title: Kraków
Content:  to rest at Rakowicki Cemetery, and the founder of modern Polish drama, Stanisław Wyspiański. Fin de siècle Kraków evolved into a modern metropolis; running water and electric streetcars were introduced in 1901, and between 1910 and 1915, Kraków and its surrounding suburban communities were gradually combined into a single administrative unit called Greater Kraków (Wielki Kraków).  At the outbreak of World War I on 3 August 1914, Józef Piłsudski formed a small cadre military unit, the First Cadre Company—the predecessor of the Polish Legions—which set out from Kraków to fight for the liberation of Poland. The city was briefly besieged by Russian troops in November 1914. Austrian rule in Kraków ended in 1918 when the Polish Liquidation Committee assumed power.
Title: Kraków Voivodeship (1816–1837)
Content:  The Kraków Voivodeship was a voivodeship of the Congress Poland, that existed from 1816 to 1837. Until 6 December 1816, its capital was Miechów, and since then it was Kielce. It was established on 16 Janiary 1816, from Kraków Department, and existed until 23 February 1837, when it was replaced by the Kraków Governorate. During the January Uprising, the Polish National Government, announced the re-establishment of the voivodeships with the borders from 1816, reestablishing the administration of the Kraków Voivodeship within the part of Radom Governorate. It existed from 1863 to 1864, when it was abolished, and replaced by the Radom Governorate. It was named after the nearby historic city of Kraków, which itself wasn't located in the voivodeship, and was instead located in the Free City of Cracow.
Title: Kraków
Content:  end of his reign. In 1038, Kraków became the seat of the Polish government. By the end of the 10th century, the city was a leading centre of trade. Brick buildings were constructed, including the Royal Wawel Castle with St. Felix and Adaukt Rotunda, Romanesque churches such as St. Adalbert's, a cathedral, and a basilica. The city was sacked and burned during the Mongol invasion of 1241. It was rebuilt practically identical, based on new location act and incorporated in 1257 by the high duke Bolesław V the Chaste who following the example of Wrocław, introduced city rights modelled on the 
Title: Kraków Voivodeship (1919–1939)
Content:  Kraków Voivodeship (województwo krakowskie) was a unit of administrative division and local government in Poland in years 1919–1939. Back then, it covered a big chunk of the southern part of the country, including such cities as Kraków, Jaworzno and Tarnów. Capital city: Kraków.

Question: when did krakow become the capital of poland?
Answer: 1038.