退款登記里摘要部分顯示退款學員名稱和退款人數代碼
declare @RecordCount intdeclare @ExamDate datetime
declare @mark varchar(50)
set @mark='[ '
select top 3 @mark=@mark+rtrim(doc_view.姓名)+' ' from doc_view where 單號=@docnum
set @mark=@mark+']等'
select top 1 @RecordCount=人數,@ExamDate=創建日期 from doc_ywmark where doc_ywmark.單號=@docnum
set @mark=@mark+'['+rtrim(cast(@recordCount as char(20)))+']人退還學費用'
if @cmdtype=1
begin
updatedoc_ywmark set 狀態=1,摘要=case when isnull(摘要,'1')='1' or 摘要='' then @mark else 摘要 end where doc_ywmark.單號=@docnum
end
else
begin
updatedoc_ywmark set 狀態=0 where doc_ywmark.單號=@docnum
end
頁:
[1]