1 Chronicles 21:1-8 CSB
Satan rose up against Israel and incited David to count the people of Israel. So David said to Joab and the commanders of the troops, “Go and count Israel from Beer-sheba to Dan and bring a report to me so I can know their number.”
Joab replied, “May the LORD multiply the number of his people a hundred times over! My lord the king, aren’t they all my lord’s servants? Why does my lord want to do this? Why should he bring guilt on Israel?”
Yet the king’s order prevailed over Joab. So Joab left and traveled throughout Israel and then returned to Jerusalem. Joab gave the total troop registration to David. In all Israel there were one million one hundred thousand armed men and in Judah itself four hundred seventy thousand armed men. But he did not include Levi and Benjamin in the count because the king’s command was detestable to him. This command was also evil in God’s sight, so he afflicted Israel.
David said to God, “I have sinned greatly because I have done this thing. Now, please take away your servant’s guilt, for I’ve been very foolish.”
CSB: Christian Standard Bible