R
Rafi
I have a query listing the transit time between two given origin points (zip
codes) and multiple destinations. I am trying to limit the results to the
one combination that list the smallest transit time -
Min(GND_TRANSIT.[SERVICE DAYS]) AS [Min DAYS]- and if the two origins have
equal transit times than select the one having the smallest value for Zone -
Min(GND_TRANSIT.ZONE) AS MinZONE. Unfortunately, the results show both
values rather than just obe row.
Your help is much appreciated.
SELECT DISTINCTROW GND_TRANSIT.DEST_ZIP, Min(GND_TRANSIT.[SERVICE DAYS]) AS
[Min DAYS], Min(GND_TRANSIT.ZONE) AS MinZONE, GND_TRANSIT.Origin
FROM GND_TRANSIT INNER JOIN Shipments ON (GND_TRANSIT.DEST_ZIP =
Shipments.DEST_ZIP) AND (GND_TRANSIT.DEST_ZIP = Shipments.DEST_ZIP)
GROUP BY GND_TRANSIT.DEST_ZIP, GND_TRANSIT.Origin;
codes) and multiple destinations. I am trying to limit the results to the
one combination that list the smallest transit time -
Min(GND_TRANSIT.[SERVICE DAYS]) AS [Min DAYS]- and if the two origins have
equal transit times than select the one having the smallest value for Zone -
Min(GND_TRANSIT.ZONE) AS MinZONE. Unfortunately, the results show both
values rather than just obe row.
Your help is much appreciated.
SELECT DISTINCTROW GND_TRANSIT.DEST_ZIP, Min(GND_TRANSIT.[SERVICE DAYS]) AS
[Min DAYS], Min(GND_TRANSIT.ZONE) AS MinZONE, GND_TRANSIT.Origin
FROM GND_TRANSIT INNER JOIN Shipments ON (GND_TRANSIT.DEST_ZIP =
Shipments.DEST_ZIP) AND (GND_TRANSIT.DEST_ZIP = Shipments.DEST_ZIP)
GROUP BY GND_TRANSIT.DEST_ZIP, GND_TRANSIT.Origin;