这是我的基本代码,注意事项是我已经从另外两个tbl_variable cost和tbl_currencies表中检索了dbo_currencyconversion表。 现在我试图从表dbo_currencyconversion添加行值,并且查询在添加行时工作正常,但是当我尝试在MS ACCESS中保存查询时出现错误请告诉我是否有任何方法可以解决此问题 这是我在ms访问中的查询
select
currencyconversion_1ST_P_OLD.MEA_ID,
currencyconversion_1ST_P_OLD.conversion-currencyconversion_OFR_P_NEW.conversion as delta
from
dbo_currencyconversion as currencyconversion_1ST_P_OLD INNER JOIN
dbo_currencyconversion as currencyconversion_OFR_P_NEW ON
(currencyconversion_1ST_P_OLD.VCOS_NAME='1ST_P_OLD' AND
currencyconversion_OFR_P_NEW.VCOS_NAME='OFR_P_NEW' AND
currencyconversion_1ST_P_OLD.MEA_ID=currencyconversion_OFR_P_NEW.MEA_ID);
错误是: 不支持连接表达式。 (错误3296)
可能的原因:
您的SQL语句包含多个联接,其中查询的结果可能会有所不同,具体取决于执行联接的顺序。您可能希望创建单独的查询以执行第一个连接,然后在SQL语句中包含该查询。 JOIN操作中的ON语句不完整或包含太多表。您可能希望将ON表达式放在WHERE子句中。
感谢您提前回复
答案 0 :(得分:0)
我认为你需要搬家
currencyconversion_1ST_P_OLD.VCOS_NAME='1ST_P_OLD' AND
currencyconversion_OFR_P_NEW.VCOS_NAME='OFR_P_NEW'
从ON条件到where where子句。
最终查询
select
currencyconversion_1ST_P_OLD.MEA_ID,
currencyconversion_1ST_P_OLD.conversion-currencyconversion_OFR_P_NEW.conversion as delta
from
dbo_currencyconversion as currencyconversion_1ST_P_OLD INNER JOIN
dbo_currencyconversion as currencyconversion_OFR_P_NEW
ON (currencyconversion_1ST_P_OLD.MEA_ID=currencyconversion_OFR_P_NEW.MEA_ID)
WHERE currencyconversion_1ST_P_OLD.VCOS_NAME='1ST_P_OLD' AND
currencyconversion_OFR_P_NEW.VCOS_NAME='OFR_P_NEW';
答案 1 :(得分:0)
试试这个:
SELECT
currencyconversion_1ST_P_OLD.MEA_ID,
currencyconversion_1ST_P_OLD.conversion-currencyconversion_OFR_P_NEW.conversion as delta
FROM
dbo_currencyconversion as currencyconversion_1ST_P_OLD
INNER JOIN dbo_currencyconversion as currencyconversion_OFR_P_NEW
ON currencyconversion_1ST_P_OLD.MEA_ID=currencyconversion_OFR_P_NEW.MEA_ID
WHERE
(((currencyconversion_1ST_P_OLD.VCOS_NAME)="1ST_P_OLD") AND
((currencyconversion_OFR_P_NEW.VCOS_NAME)="OFR_P_NEW"));