Add support for queries before and after datetime