行38无法在int上调用方法

行38无法在int上调用方法

本文介绍了此查询中的错误“消息258,级别15,状态1,行38无法在int上调用方法". PLZ帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

select * from SAl_OrderHeader soh
where (
select  OrderID from (
select
SAL_OrderDetail.Quantity as SalesOrderQuantity
, isnull((
select SUM(Quantity) from SAL_deliveryOrderDetail
where SAL_deliveryOrderDetail.SalesOrderHeaderID = SAL_OrderHeader.OrderID
and SAL_deliveryOrderDetail.SalesOrderDetailID = SAL_OrderDetail.OrderDetailID
and SAL_deliveryOrderDetail.CompanyID = SAL_OrderHeader.CompanyID
and SAL_deliveryOrderDetail.PeriodID = SAL_OrderHeader.PeriodID
and SAL_deliveryOrderDetail.Status = 1

),0 ) as DeliveryOrderQuantity
,isnull  (SAL_OrderDetail.ReversedQuantity , 0 )as Rev_Qty
,SET_DocumentType.DocumentType
, SAL_OrderHeader.ContractNo
,SAL_OrderHeader.ContractDate
,SAL_OrderHeader.OrderID
from SAL_OrderHeader

inner join SAL_OrderDetail on  SAL_OrderDetail.OrderID = SAL_OrderHeader.OrderID
and SAL_OrderDetail.CompanyID = SAL_OrderHeader.CompanyID
and SAL_OrderDetail.PeriodID = SAL_OrderHeader.PeriodID
and SAL_OrderDetail.status = 1
and SAL_OrderHeader.Status = 1

inner join SET_DocumentType on SET_DocumentType.DocumentTypeID =  SAL_OrderHeader.SaleContractTypeID
and SET_DocumentType.CompanyID =  SAL_OrderHeader.CompanyID
and SET_DocumentType.PeriodID =  SAL_OrderHeader.PeriodID
and SET_DocumentType.Status =  1
) as tab

where (tab.SalesOrderQuantity - DeliveryOrderQuantity) - tab.Rev_Qty > 0


).[OrderID] = soh.OrderID

推荐答案


这篇关于此查询中的错误“消息258,级别15,状态1,行38无法在int上调用方法". PLZ帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 19:51