我有一个旧工具,正在尝试将其更新为新的数据源。除了当我尝试根据负载数更新特定记录时,该工具上的所有内容似乎都正常工作。现在,该列从 NUMBER 格式更改为 STRING 格式。这是唯一的区别。
我的表单上有一个按钮,单击它时会运行两个单独的宏。一个对 WCL_DATABASE 运行更新查询,另一个则更新另一个表 (TrafficDatabase) 中的相同记录。单击该按钮时,我会在 WCL_DATABASE 表中获取更新,但不会获取 TrafficDatabase 记录。
这是更新 WCL_DATABASE 的 SQL
UPDATE WCL_DATABASE_QUERY
SET WCL_DATABASE_QUERY.CARRIER = UCASE([Forms] ! [Edit_Load] ! [CARRIER])
,WCL_DATABASE_QUERY.COMMENTS = Forms ! Edit_Load ! [COMMENTS]
,WCL_DATABASE_QUERY.DISPATCH_NOTES = Forms ! Edit_Load ! [DISPATCH_NOTES]
,WCL_DATABASE_QUERY.CUSTOMER_CANCEL_DATE = [Forms] ! [Edit_Load] ! [CUSTOMER_CANCEL_DATE]
,WCL_DATABASE_QUERY.TRAFFIC_SPECIALIST = [Forms] ! [Edit_Load] ! [TRAFFIC_SPECIALIST]
,WCL_DATABASE_QUERY.RR_DATE = [Forms] ! [Edit_Load] ! [RR_DATE]
,WCL_DATABASE_QUERY.RA_DATE = [Forms] ! [Edit_Load] ! [RA_DATE]
,WCL_DATABASE_QUERY.PLANNED_SHIP_DATE = [Forms] ! [Edit_Load] ! [PLANNED_SHIP_DATE]
,WCL_DATABASE_QUERY.CONFIRMATION_NUMBER = [Forms] ! [Edit_Load] ! [CONFIRMATION_NUMBER]
,WCL_DATABASE_QUERY.WR_ID = [Forms] ! [Edit_Load] ! [WR_ID]
,WCL_DATABASE_QUERY.LAST_UPDATE = Now()
WHERE (
((WCL_DATABASE_QUERY ! SHIPPING_LOAD_NUMBER) = Forms ! Edit_Load ! SHIPPING_LOAD_NUMBER_Title)
AND ((WCL_DATABASE_QUERY.SHIPPING_LOAD_NUMBER) <> "0")
);
这是我用于更新 TrafficDatabase 的 SQL
UPDATE TrafficDatabase_Query
SET TrafficDatabase_Query.CARRIER_ID = ucase([Forms] ! [Edit_Delivery] ! [CARRIER])
,TrafficDatabase_Query.COMMENTS = Forms ! Edit_Delivery ! [COMMENTS]
,TrafficDatabase_Query.DISPATCH_NOTES = Forms ! Edit_Delivery ! [DISPATCH_NOTES]
,TrafficDatabase_Query.CUSTOMER_CANCEL_DATE = [Forms] ! [Edit_Delivery] ! [CUSTOMER_CANCEL_DATE]
,TrafficDatabase_Query.TRAFFIC_SPECIALIST = [Forms] ! [Edit_Delivery] ! [TRAFFIC_SPECIALIST]
,TrafficDatabase_Query.RR_DATE = [Forms] ! [Edit_Delivery] ! [RR_DATE]
,TrafficDatabase_Query.RA_DATE = [Forms] ! [Edit_Delivery] ! [RA_DATE]
,TrafficDatabase_Query.PLANNED_SHIP_DATE = [Forms] ! [Edit_Delivery] ! [PLANNED_SHIP_DATE]
,TrafficDatabase_Query.CONFIRMATION_NUMBER = [Forms] ! [Edit_Delivery] ! [CONFIRMATION_NUMBER]
,TrafficDatabase_Query.WR_ID = [Forms] ! [Edit_Delivery] ! [WR_ID]
,TrafficDatabase_Query.LAST_UPDATE = NOW()
WHERE (
(([TrafficDatabase_Query] ! SHIPPING_LOAD_NUMBER) = Forms ! Edit_Load ! SHIPPING_LOAD_NUMBER_Title)
AND (([TRAFFICDATABASE_Query] ! [SHIPPING_LOAD_NUMBER]) <> "0")
);
运行此命令时出现错误,并且在 TrafficDatabase 更新部分出现错误。
此时我只是不确定该怎么做,我已经仔细检查了所有字段以确保它们都是字符串而不是数字。
哪里( (([TrafficDatabase_Query] !SHIPPING_LOAD_NUMBER) = '表单!Edit_Load !SHIPPING_LOAD_NUMBER_Title') AND (([TRAFFICDATABASE_Query] ![SHIPPING_LOAD_NUMBER]) <>“0”) );