左外部联接中的无效操作(在Access中)

时间:2019-02-08 16:24:48

标签: sql ms-access

我有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;

我查找了错误,但找到了此页面,但是它没有说明查询联接。 https://docs.microsoft.com/en-us/office/vba/access/concepts/miscellaneous/invalid-operationerror-3219?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev11.query%3FappId%3DDev11IDEF1%26l%3Den-US%26k%3Dk(jeterr40.chm5003219)%3Bk(TargetFrameworkMoniker-Office.Version%3Dv16)%26rd%3Dtrue

0 个答案:

没有答案