Updated error query to select the datetime with local time