  By using the $q$-analogue of van der Corput's method we study the divisor
function in an arithmetic progression to modulus $q$. We show that the expected
asymptotic formula holds for a larger range of $q$ than was previously known,
provided that $q$ has a certain factorisation.
