'Census' in the Bible
Then Satan attacked Israel by inciting David to enumerate a census of Israel.
David ordered Joab and the commanders of the army, "Go take a census of Israel from Beer-sheba to Dan, and bring me a report so I can be aware of the total number."
Levi and Benjamin were not included in the census, because what the king had commanded was unethical to Joab.
David told God, "Wasn't I the one who ordered the census of the population? Wasn't it I who sinned and acted wickedly? Now as for these sheep, what have they done? LORD God, please let your hand be against me and my ancestral household, but don't let your people be ravaged by plague!"
David did not complete a census of those younger than 20 years of age, since the LORD had said he would make Israel as numerous as the stars of heaven.
Zeruiah's son Joab began the census, but never completed it. Nevertheless, God became angry with Israel because of this, so the number was never entered into the official records of the Annals of King David.