SqlCommand cmd = new SqlCommand("Select DISTINCT Flightno,DESCR,substring(SCH_TIME,10,4) as ScheduleTime,Destination,Status,Gate from DFlights where(INT_DOM='I' and ARR_DEP='D') order by substring(SCH_TIME,10,4)", con);
order by clause should always place after where clause