Added function for filling DailyHistory table