/*********以下存储历程用于批量录进材料**************/
createProcedureAddWorkCalendar@BDateSmallDateTime,@EDateSmallDateTime
As
Declare@CDateSmallDateTime
Declare@Flag1Bit
Declare@Flag2Bit
Declare@Flag3Bit
Set@CDate=@BDate
IfExists(Select*fromcalendarWherecld_rqBetween@BDateAnd@EDate)
Begin
Raiserror(已有该局限的材料,请查对入手下手日期和停止日期!!!,16,-1)
Return
End
While@CDate<=@EDate
Begin
Set@Flag1=(CaseWhenDatePart(WeekDay,@CDate)in(1,7)then0Else1End)
Set@Flag2=(CaseWhenDatePart(WeekDay,@CDate)=1then0Else1End)
Set@Flag3=1
InsertcalendarValues(@CDate,@Flag,@Flag1,@Flag2)
Set@CDate=DateAdd(Day,1,@CDate)
End
/****************以下处置失掉 考勤明细表1:**********/
--1.创立一个兼并的函数
createfunctionf_kqlist(@worknochar(6),@datechar(8))
returnsvarchar(400)
as
begin
declare@strvarchar(1000)
set@str=
select@str=@str+/+convert(char(8),[date],108)fromtimecard
whereworkno=@worknoanddatediff(day,[date],@date)=0
set@str=right(@str,len(@str)-1)
return(@str)
End