Query works for dates

check comments