ByDay to database