Fixed select by datetime