Hi all
SELECT
[OwnerId] = [QS_CRM_IF].dbo.fn_Order_SalesRepId(OH.SalesOrderId),
[Order-Won] = SUM(TotalAmount)
FROM [QS_MSCRM].dbo.SalesOrder OH WITH (NOLOCK)
WHERE CreatedOn BETWEEN @BegUTCDate AND @EndUTCDate
AND [QS_CRM_IF].dbo.fn_Order_Is10Revenue(OH.SalesOrderId) IN (@Is10Revenue)
AND TotalAmount > 0.00
--AND StateCode <> 2
GROUP BY [QS_CRM_IF].dbo.fn_Order_SalesRepId(OH.SalesOrderId)
) OW ON OW.OwnerId = U.SystemUserId
What is the meaning of this Query.? I do not know. What are these lines?
*This post is locked for comments