select ic2.FDeptID as deptid,it2.FNumber as fnumber, ic.Famount as famount into #te_hu
from ICStockBillEntry ic left join ICStockBill ic2 on ic.FInterID = ic2.FInterID left join
t_icitem it on ic.FItemID = it.fitemid left join t_item it2 on it.fparentid = it2.fitemid
where ic2.FDate = '********' and ic.FDCStockID = ''