1 Chronicles 21:1-4 New King James Version (NKJV)
The Census of Israel and Judah
21 Now Satan stood up against Israel, and moved David to [a]number Israel. 2 So David said to Joab and to the leaders of the people, “Go, number Israel from Beersheba to Dan, and bring the number of them to me that I may know it.”
3 And Joab answered, “May the Lord make His people a hundred times more than they are. But, my lord the king, are they not all my lord’s servants? Why then does my lord require this thing? Why should he be a cause of guilt in Israel?”
4 Nevertheless the king’s word prevailed against Joab. Therefore Joab departed and went throughout all Israel and came to Jerusalem.