打印本文 打印本文 关闭窗口 关闭窗口
SQL 以日期动态更新维护的数据,一周排程时间日期设计
作者:武汉SEO闵涛  文章来源:敏韬网  点击数27304  更新时间:2007/11/14 12:58:28  文章录入:mintao  责任编辑:mintao
              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] 

打印本文 打印本文 关闭窗口 关闭窗口