I usually book a couple of days or at most a week in advance. Depends on the property but normally if there is space that late in the game the hotels are pretty happy to provide decent rates or an upgrade. If not I just go someplace else... or go at another time.