Refined code for datetime field and removal of repeatschedule column