| and Ltrim(Rtrim(t1.Revision)) = Ltrim(Rtrim(t2.Revision))
and convert(datetime, @BDateTime) = t2.DateId
Select t1.*, BDateTime = convert(datetime, @BDateTime) , EDateTime =convert(datetime, @EDateTime)
From #StknWipTotal t1 , #WeekProcedure t2
Where t1.Partnum = t2.Partnum and t1.Revision = t2.Revision
End
Else
If @Flage = 1
Begin
Update t1 Set A0=Qnty1, A1=Qnty2, A2=Qnty3, A3=Qnty4, A4=Qnty5, A5=Qnty6, A6=Qnty7, t1.DelDate =t2.Todate
From #StknWipTotal t1, Pdl_WeekProcedure t2
Where Ltrim(Rtrim(t1.PartNum)) = Ltrim(Rtrim(t2.PartNum))
and Ltrim(Rtrim(t1.Revision)) = Ltrim(Rtrim(t2.Revision))
and convert(datetime, @BDateTime) = t2.DateId
Select t1.*, BDateTime = convert(datetime, @BDateTime) , EDateTime =convert(datetime, @EDateTime)
From #StknWipTotal t1
End
<< 上一页 [21] |