1 Chronicles 20:1

Amplified Bible (AMP)
Then it happened at the end of the year, [a]at the time when kings go out to battle, Joab led out the army and ravaged and devastated the land of the Ammonites, and came and besieged Rabbah. But David stayed at Jerusalem [with Bathsheba]. Joab struck Rabbah and overthrew it.

Read 1 Chronicles 20:1 in other translations