Once again the anger of the LORD burned against Israel, and he caused David to harm them by taking a census. "Go and count the people of Israel and Judah," the LORD told him.
So the king said to Joab, the commander of his army, "Take a census of all the people in the land -- from Dan in the north to Beersheba in the south -- so that I may know how many people there are."
But Joab replied to the king, "May the LORD your God let you live until there are a hundred times as many people in your kingdom as there are now! But why do you want to do this?"
But the king insisted that they take the census, so Joab and his officers went out to count the people of Israel.
First they crossed the Jordan and camped at Aroer, south of the town in the valley, in the direction of Gad. Then they went on to Jazer,
then to Gilead in the land of Tahtim-hodshi and to Dan-jaan and around to Sidon.
References for 2 Samuel 24:6
Then they came to the stronghold of Tyre, and all the cities of the Hivites and Canaanites. Finally, they went south to Judah as far as Beersheba.
Having gone through the entire land, they completed their task in nine months and twenty days and then returned to Jerusalem.
Joab reported the number of people to the king. There were 800,000 men of military age in Israel and 500,000 in Judah.