2

错误出现在“whs.description”列上。它不会在加入 'ExactOnlineREST.Inventory.Warehouses Whs on Whs.ID=SHO.Warehouse' 时给出任何错误

select  Pro.code
,      ShopOrderNumber
,      SHO.status
,      SHO.Description
,      ItemVersionDescription
,      BOM.CalculatedCostprice
,      SHO.PlannedDate
,      Whs.description
from   ExactOnlineRest.manufacturing.ShopOrders SHO
join   ExactOnlineREST.Project.Projects Pro on SHO.PROJECT=Pro.ID 
join   ExactOnlineXML.XML.ManufacturedBillOfMaterials BOM on "{" + SHO.ItemVersion  + "}"= BOM.ID_attr 
join   ExactOnlineREST.Inventory.Warehouses Whs on Whs.ID=SHO.Warehouse
Group 
by     Pro.code
,      ShopOrderNumber
,      SHO.status
,      BOM.CalculatedCostprice
order 
By     Pro.code
,      ShopOrderNumber
,      SHO.status
,      BOM.CalculatedCostprice
4

1 回答 1

1

尝试以下查询:

select Pro.code
,      sho.ShopOrderNumber
,      SHO.status
,      SHO.Description
,      sho.ItemVersionDescription
,      BOM.CalculatedCostprice
,      SHO.PlannedDate
,      Whs.description
from   ExactOnlineRest..ShopOrders SHO
join   ExactOnlineREST..Projects Pro 
on     Pro.ID  = SHO.PROJECT
join   ExactOnlineXML..ManufacturedBillOfMaterials BOM 
on     BOM.ID_attr  = '{' || SHO.ItemVersion || '}'
join   ExactOnlineREST..Warehouses Whs 
on     Whs.ID = SHO.Warehouse
Group 
by     Pro.code
,      sho.ShopOrderNumber
,      SHO.status
,      BOM.CalculatedCostprice
order 
By     Pro.code
,      sho.ShopOrderNumber
,      SHO.status
,      BOM.CalculatedCostprice

此查询的结构不同,例如参见“与 ',以及使用 || 而不是 +。

在我的 Exact Online 环境中,这个可以工作。

于 2017-04-05T10:17:09.107 回答