转载自:http://www.czerp.com.cn/page/Default.asp?ID=372
可通过Excel获取外部数据的方式与SQL数据库创建查询连接,并导入到Excel中:
Select a.cWhcode 仓库编码,b.cWhName 仓库名称,a.cinvcode 存货编码,c.cInvName 存货名称,a.iquantity 结存数量,a.foutquantity 待发货数量,a.iquantity-a.foutquantity 可用量
from
UFDATA_007_2011.dbo.CurrentStock a, --现存量汇总表
UFDATA_007_2011.dbo.Warehouse b, --仓库档案
UFDATA_007_2011.dbo.Inventory c --存货档案
where
b.cWhCode = a.cWhcode
and c.cInvCode = a.cinvcode
and a.iquantity <> 0
and a.cwhcode = 120
order by 存货编码