名为“ID”的列已属于此 DataTable。

执行查询:select a.*,b.*,
(case c.State 
when 'Approved' then '完成' 
when 'Running' then '在途' 
when 'Rejected' then '拒签'
when 'Aborted' then '撤单'
when 'Deleted' then '删除' 
else '' END) as State
FROM dbo.FLOW_PUR_019_DT a
inner join [dbo].[FLOW_PUR_019] b on a.taskid= b.taskid 
left join BPMInstTasks c on a.taskid=c.TaskID
where (@SN is NULL or SN LIKE N'%'+@SN+'%') and (AppDate between @StartDate and @EndDate) and 
(@TotalAmount is NULL or TotalAmount LIKE N'%'+@TotalAmount+'%')
and (@State is null or c.State like '%'+(case @State when '完成' then 'Approved' 
when '在途' then 'Running' 
when '拒签' then 'Rejected'
when '撤单' then 'Aborted'
when '删除' then 'Deleted' 
else '' END)+'%'
)失败!原因:
名为“ID”的列已属于此 DataTable。
已邀请:

要回复问题请先登录注册