1:
2:
3:
4:
5:
|
SELECT ROUTE_SETS.ROUTING_DATE, ROUTES.ROUTE_NAME, DRIVER.NAME, DRIVER_1.NAME AS DRIVER2NAME, DRIVER_1.EMPLOYEENUMBER AS EMPLOYEENUMBER2, VEHICLE.NAME, VEHICLE.ODOMETER, CUSTOMER.WHOLE_ACCOUNT_ID, ORDERS.ORDER_ID, CUSTOMER.NAME, CUSTOMER.STREET_ADDRESS, CUSTOMER.PHONE_NUMBER, ORDERS.HW_OPEN_TIME, ORDERS.HW_CLOSE_TIME, ROUTE_STOPS.ARRIVAL_TIME, ROUTE_STOPS.DEPARTURE_TIME, CUSTOMER.STOP_ID, VEHICLE_1.NAME, VEHICLE.DRIVER_ID1, VEHICLE.VEHICLETYPE, VEHICLE_1.VEHICLETYPE, DRIVER.EMPLOYEENUMBER, ROUTE_STOPS.STOP_NUMBER, ORDERS.COMMENT_ROUTE_SHEET, ORDERS.ORDER_SIZE_VOLUME, ROUTES.DISPATCH_TIME, ROUTES.DELIVERY_VOLUME, VEHICLE_1.DRIVER_ID2, DRIVER.TEAMMATEID, ROUTES.DRIVER_ID2, ROUTES.VEHICLE_TYPE3, VEHICLE_2.NAME, CUSTOMER.NICKNAME, STOP.STOP_NAME, STOP.STREET_ADDRESS, STOP.CITY, STOP.STATE, STOP.COMMENTS, STOP.PHONE_NUMBER, STOP.ZIP
FROM (((((ROUTE_STOPS INNER JOIN (((VEHICLE INNER JOIN (ROUTE_SETS INNER JOIN ROUTES ON ROUTE_SETS.ROUTE_SET_INDEX = ROUTES.ROUTE_SET_INDEX) ON VEHICLE.VEHICLE_ID = ROUTES.VEHICLE_ID1) LEFT JOIN VEHICLE AS VEHICLE_1 ON ROUTES.VEHICLE_ID2 = VEHICLE_1.VEHICLE_ID) INNER JOIN DRIVER ON ROUTES.DRIVER_ID1 = DRIVER.INTERNALID) ON ROUTE_STOPS.ROUTE_INDEX = ROUTES.ROUTE_INDEX) INNER JOIN RSTOP_ORDER ON ROUTE_STOPS.STOP_INDEX = RSTOP_ORDER.STOP_INDEX) INNER JOIN (CUSTOMER INNER JOIN ORDERS ON CUSTOMER.CUSTOMER_ID = ORDERS.CUSTOMER_ID) ON RSTOP_ORDER.ORDER_ID = ORDERS.ORDER_ID) LEFT JOIN DRIVER AS DRIVER_1 ON ROUTES.DRIVER_ID2 = DRIVER_1.INTERNALID) LEFT JOIN VEHICLE AS VEHICLE_2 ON ROUTES.VEHICLE_ID3 = VEHICLE_2.VEHICLE_ID) INNER JOIN STOP ON ROUTE_STOPS.STOP_ID = STOP.STOP_ID
GROUP BY ROUTE_SETS.ROUTING_DATE, ROUTES.ROUTE_NAME, DRIVER.NAME, DRIVER_1.NAME, DRIVER_1.EMPLOYEENUMBER, VEHICLE.NAME, VEHICLE.ODOMETER, CUSTOMER.WHOLE_ACCOUNT_ID, ORDERS.ORDER_ID, CUSTOMER.NAME, CUSTOMER.STREET_ADDRESS, CUSTOMER.PHONE_NUMBER, ORDERS.HW_OPEN_TIME, ORDERS.HW_CLOSE_TIME, ROUTE_STOPS.ARRIVAL_TIME, ROUTE_STOPS.DEPARTURE_TIME, CUSTOMER.STOP_ID, VEHICLE_1.NAME, VEHICLE.DRIVER_ID1, VEHICLE.VEHICLETYPE, VEHICLE_1.VEHICLETYPE, DRIVER.EMPLOYEENUMBER, ROUTE_STOPS.STOP_NUMBER, ORDERS.COMMENT_ROUTE_SHEET, ORDERS.ORDER_SIZE_VOLUME, ROUTES.DISPATCH_TIME, ROUTES.DELIVERY_VOLUME, VEHICLE_1.DRIVER_ID2, DRIVER.TEAMMATEID, ROUTES.DRIVER_ID2, ROUTES.VEHICLE_TYPE3, VEHICLE_2.NAME, CUSTOMER.NICKNAME, STOP.STOP_NAME, STOP.STREET_ADDRESS, STOP.CITY, STOP.STATE, STOP.COMMENTS, STOP.PHONE_NUMBER, STOP.ZIP
HAVING (((ROUTE_SETS.ROUTING_DATE)=[Enter Routing Date]) AND ((ROUTES.ROUTE_NAME)=[ENTER ROUTE_NAME]))
ORDER BY ROUTES.ROUTE_NAME;
|