Fix query to sort between decade spans with inclusive dates