fix history and made sqlDate consistent