Fix system notice undefined variable days_old

Commit fbd654083f061fcfcc8dc7229953cc44737889fa added t_ prefix to some
variables, but did not replace all occurences of the old variable name,
causing SQL syntax error depending on filter

Fixes #16527