2 Samuel 24:1-4 (KJV)
1 And again the anger of the Lord was kindled against Israel, and he moved David against them to say, Go, number Israel and Judah.
2 For the king said to Joab the captain of the host, which was with him, Go now through all the tribes of Israel, from Dan even to Beersheba, and number ye the people, that I may know the number of the people.
3 And Joab said unto the king, Now the Lord thy God add unto the people, how many soever they be, an hundredfold, and that the eyes of my lord the king may see it: but why doth my lord the king delight in this thing?
4 Notwithstanding the king’s word prevailed against Joab, and against the captains of the host. And Joab and the captains of the host went out from the presence of the king, to number the people of Israel.