北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |
我写的SQL语句显示不了我要的效果。详见附件!
select "" AS ID,年份月份 AS 进出仓时间,物料编码,dlookup("[物料名称]","物料表","物料编码='"&[物料编码]&"'") AS 物料名称,规格 AS 物料规格,期初金额/期初数量 AS 单价,单位 AS 计量单位,"" AS 进仓数量,"" AS 进仓总价,"" AS 出仓数量,"" AS 出仓总价,期初数量 AS 余数,期初金额 AS 余额,"期初数" AS 番号,"期初数" AS 进出仓单号码,"期初数" AS 送货单号码,"期初数" AS 供应商或领用人,"期初数" AS 附注,"期初数" AS 单据类型
from 历史进销存
where dlookup("[物料名称]","物料表","物料编码='"&[物料编码]&"'") like "*" & [请输入物料名称] & "*"
ORDER BY 物料编码
union all select 进仓单!进仓ID,进仓时间,物料编码,dlookup("[物料名称]","物料表","物料编码='"&[物料编码]&"'") AS 物料名称,规格,单价,单位,数量,数量*单价,"","","","",番号,进仓单号码,送货单号码,供应商,进仓单!备注 & 进仓单明细!备注,单据类型
from 进仓单 inner join 进仓单明细 ON 进仓单.进仓ID = 进仓单明细.进仓ID
where dlookup("[物料名称]","物料表","物料编码='"&[物料编码]&"'") like "*" & [请输入物料名称] & "*"
UNION ALL select 出仓单!出仓ID,出仓日期,物料编码,dlookup("[物料名称]","物料表","物料编码='"&[物料编码]&"'") AS 物料名称,规格,单价,单位,"","",数量,数量*单价,"","",番号,出仓单号码,0,经手人,出仓单!备注 & 出仓单明细!备注,单据类型
from 出仓单 inner join 出仓单明细 ON 出仓单.出仓ID = 出仓单明细.出仓ID
where dlookup("[物料名称]","物料表","物料编码='"&[物料编码]&"'") like "*" & [请输入物料名称] & "*";