2 Samuel 24:1-9 New King James Version (NKJV)
David’s Census of Israel and Judah
24 Again the anger of the Lord was aroused against Israel, and He moved David against them to say, “Go, [a]number Israel and Judah.”
2 So the king said to Joab the commander of the army who was with him, “Now go throughout all the tribes of Israel, from Dan to Beersheba, and count the people, that I may know the number of the people.”
3 And Joab said to the king, “Now may the Lord your God add to the people a hundred times more than there are, and may the eyes of my lord the king see it. But why does my lord the king desire this thing?” 4 Nevertheless the king’s word [b]prevailed against Joab and against the captains of the army. Therefore Joab and the captains of the army went out from the presence of the king to count the people of Israel.
5 And they crossed over the Jordan and camped in Aroer, on the right side of the town which is in the midst of the ravine of Gad, and toward Jazer. 6 Then they came to Gilead and to the land of Tahtim Hodshi; they came to Dan Jaan and around to Sidon; 7 and they came to the stronghold of Tyre and to all the cities of the Hivites and the Canaanites. Then they went out to South Judah as far as Beersheba. 8 So when they had gone through all the land, they came to Jerusalem at the end of nine months and twenty days. 9 Then Joab gave the sum of the number of the people to the king. And there were in Israel eight hundred thousand valiant men who drew the sword, and the men of Judah were five hundred thousand men.