做Syteline System维护,用户特多要求,今天需要为用户修改一个Material Transaction Report. 具体实现如下,可以参考:

代码
CREATE PROCEDURE [dbo].[usp_SyteLine_GetMaterialTransactionsReport]
(
    
@ConditionExpression nvarchar(3000)
)
AS 
DECLARE @sql nvarchar(4000= 'SELECT mt.[trans_num] AS [Trans Number] ,mt.[trans_date] AS [Trans Date],mt.[item] AS [Item],i.[description] AS [Description],mt.[qty] AS [Quantity],i.[u_m] AS [U/M],mt.[cost] AS [Cost],mt.[reason_code] AS [Reason Code] 
FROM [dbo].[matltran] mt
LEFT JOIN [dbo].[item] i ON (mt.[item] = i.[item])
'
IF LEN(@ConditionExpression> 0
    
SELECT @sql += ' WHERE ' + @ConditionExpression
EXECUTE(@sql)

 

 

相关文章:

  • 2021-09-24
  • 2021-12-21
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2021-06-17
  • 2021-08-12
猜你喜欢
  • 2021-10-16
  • 2021-08-23
  • 2021-09-12
  • 2021-10-28
  • 2021-11-20
相关资源
相似解决方案