1:
Insert into SaleInOut(Stuff_no,[Local],amount,[Usage]) select   [UMAX_CustDB].[dbo].bom.stuff_no,  [UMAX_CustDB].[dbo].IO_product.[Local],  [UMAX_CustDB].[dbo].IO_product.amount,  [UMAX_CustDB].[dbo].bom.amount from  [UMAX_CustDB].[dbo].bom ,  [UMAX_CustDB].[dbo].IO_product where         [UMAX_CustDB].[dbo].bom.bom_no= [UMAX_CustDB].[dbo].IO_product.bom_no and  [UMAX_CustDB].[dbo].IO_product.date>=@C_BeginDate  and  [UMAX_CustDB].[dbo].IO_product.date<= @C_EndDate  and  [UMAX_CustDB].[dbo].IO_product.[io]=1
2: 
  下次请贴出你的出错信息。

解决方案 »

  1.   

    Insert into SaleInOut(Stuff_no,[Local],amount,[Usage]) 
    select A.stuff_no,A.[Local],A.amount,B.amount 
    from [UMAX_CustDB].[dbo].bom A ,[UMAX_CustDB].[dbo].IO_product B 
    where B.bom_no= A.bom_no and  A.date >= @C_BeginDate and  A.date<= @C_EndDate  and A.[io]=1
      

  2.   

    Insert into SaleInOut
    (Stuff_no,
    [Local],
    amount,
    [Usage]) 
    (select   
    A.stuff_no,  
    B.[Local],  
    B.amount,  
    A.amount 
    from  [UMAX_CustDB].[dbo].bom A,  [UMAX_CustDB].[dbo].IO_product B
    where A.bom_no= B.bom_no 
    and  B.date>=@C_BeginDate  
    and  B.date<= @C_EndDate  
    and  B.[io]=1)
      

  3.   

    Insert into SaleInOut
    (Stuff_no,
    [Local],
    amount,
    [Usage]) 
    (select   
    A.stuff_no,  
    B.[Local],  
    B.amount,  
    A.amount 
    from  [UMAX_CustDB].[dbo].bom A,  [UMAX_CustDB].[dbo].IO_product B
    where A.bom_no= B.bom_no 
    and  B.date>=@C_BeginDate  
    and  B.date<= @C_EndDate  
    and  B.[io]=1)
      

  4.   

    Insert into SaleInOut(Stuff_no,[Local],amount,[Usage]) 
    (select   a.stuff_no, 
     b.[Local], 
     b.amount,  
    a.amount from  [UMAX_CustDB].[dbo].bom a,
      [UMAX_CustDB].[dbo].IO_product b where     
        a.bom_no= b.bom_no and 
     b.[date]>=@C_BeginDate 
     and  b.[date]<= @C_EndDate  and  
    b.[io]=1)