Sorting table by trip/scheduled