Fix query dates