handle datetime or just date strings in query