I Chronicles 21:1-4
"Satan rose up against Israel and incited David to take a census of Israel. 2 So David said to Joab and the commanders of the troops, “Go and count the Israelites from Beersheba to Dan. Then report back to me so that I may know how many there are.” 3 But Joab replied, “May the Lord multiply his troops a hundred times over. My lord the king, are they not all my lord’s subjects? Why does my lord want to do this? Why should he bring guilt on Israel?”I Chronicles 21:1-4 NIV
4 The king’s word, however, overruled Joab; so Joab left and went throughout Israel and then came back to Jerusalem."