2 Samuel 24:1-9

ISV(i) 1 David Takes a Census of Israel
Later, God’s anger blazed forth against Israel, so he incited David to move against them by telling him, “Go take a census of Israel and Judah.”
2 So the king ordered Joab, commander of the special forces, who was with him, “Go throughout the tribes of Israel from Dan to Beer-sheba and take a census of the people so I can be made aware of the total number.”
3 But Joab replied, “May the LORD your God increase the population of the people a hundredfold while your majesty the king is still alive to see it happen! But why does your majesty the king want to do this?”
4 But the king’s order overruled Joab and the commanders of the special forces, so Joab and the commanders of the special forces left David’s presence to take a census of the people of Israel. 5 They crossed the Jordan River, encamped at Aroer south of the town that is located in the river valley, proceeding through Gad and then on toward Jazer. 6 They went on to Gilead and the territory of Tahtim-hodshi, then on toward Dan. From Dan they went around to Sidon 7 and arrived at the fortified city of Tyre and all of the towns of the Hivites and Canaanites.
Eventually they proceeded to Beer-sheba in the Judean Negev. 8 After they had traveled throughout the entire land, they returned to Jerusalem at the end of nine months and 20 days. 9 Joab reported the total number of men to the king. In Israel there were 800,000 men trained for war. In Judah there were 500,000.