The following spring, at the time of the year when kings usually go to war, David sent out Joab with his officers and the Israelite army; they defeated the Ammonites and besieged the city of Rabbah. But David himself stayed in Jerusalem. 1
References for 2 Samuel 11:1
11.1 1 Ch 20.1.