我有2个查询工作正常,当我将它们与右外部联接或内部联接连接在一起时,它们工作正常,但左内部联接给我无效操作错误。
这是第一个查询:
SELECT tblStops.StopID, tblStops.StopNotes, tblStops.PK, tblStops.StopDescription,
tblStops.SequenceNum, tblStops.CustNum, tblStops.Cases, tblStops.Highlight,
tblStops.Warning, DateValue(Mid([PK],InStr([PK],"|")+1)) AS [Date],
Left([PK],InStr([PK],"|")-1) AS RouteNum
FROM tblStops
WHERE (((DateValue(Mid([PK],InStr([PK],"|")+1)))=#2/7/2019#))
ORDER BY tblStops.SequenceNum;
这是第二个查询:
SELECT TSDBA_DP_STOP.ROUTE_DATE, [ROUTE_ID] & '|' & [ROUTE_DATE] AS PK,
TSDBA_DP_STOP.LOCATION_ID, [PROJECTED_DEPARTURE]-(5/24) AS PD,
[PROJECTED_ARRIVAL]-(5/24) AS PA, [ACTUAL_ARRIVAL]-(5/24) AS AA,
[ACTUAL_DEPARTURE]-(5/24) AS AD, [OPEN_TIME]-(5/24) AS OT,
[CLOSE_TIME]-(5/24) AS CT
FROM TSDBA_DP_STOP
WHERE (((TSDBA_DP_STOP.ROUTE_DATE)=#2/7/2019#));
这是当我在它们上进行左外部连接时:
SELECT qryStopsForRoutesOnDate.StopID, qryStopsForRoutesOnDate.PK,
qryStopsForRoutesOnDate.StopDescription, qryStopsForRoutesOnDate.SequenceNum,
qryStopsForRoutesOnDate.CustNum, qryStopsForRoutesOnDate.Highlight,
qryStopsForRoutesOnDate.Warning
FROM qryStopsForRoutesOnDate
LEFT JOIN qryStopsInfoInRoadnet ON qryStopsForRoutesOnDate.CustNum = qryStopsInfoInRoadnet.LOCATION_ID
ORDER BY qryStopsForRoutesOnDate.SequenceNum;