加好友 发短信
等级:一尾狐
帖子:481
积分:3258
威望:0
精华:0
注册:2015/6/2 8:33:00
|
关于SQL查询问题 Post By:2018/3/26 16:23:00 [显示全部帖子]
S elect t1.[项目编号],t1.[客户名称],t1.[物料代码],t1.[物料名称],t1.[规格型号],t1.[客户对应物料代码], t1.[客户对应物料名称],t1.[实发数量],t1.[批号],t2.[FJianYanShuiPing],t2.[FAQLC],t2.[FAQLDF],t2.[FAQLUT], t2.[FAQLIR],t2.[FAQLWaiGuan],t2.[FAQLYaMinDianYa],t2.[FAQLLouDianLiu],t2.[FAQLXianXingXiShu], t2.[FAQLChongJiDianLiu],t2.[FCeDianYa],t2.[FCePinLv],t2.[FCeDianRongLiangC],t2.[FCeSunHaoDF], t2.[FCeNaiDianYaUT],t2.[FJueYuanDianZu],t2.[FCSL],t2.[FCUSL],t2.[FCLSL],t2.[FDFSL],t2.[FDFUSL], t2.[FDFLSL],t2.[FD],t2.[FT],t2.[FF],t2.[FD_d],t2.[FL],t2.[FWenDu],t2.[FShiDu],t2.[FYaMinWaiGuan], t2.[FYaMinDianZuChiCun],t2.[FYaMinDianYa],t2.[FLouDianLiu],t2.[FXianXingXiShu],t2.[FZuiDaChongJiDianLiu], t2.[FJingDianRongLiang],t2.[FSunHaoQieJiao],t2.[FHuiLuDianYa],t2.[FLangYongDianYa],t2.[FNaiDianYa], t2.[FJueYuanDianZu_1],t2.[FZuRan],t2.[FKeHanXing],t2.[FLaShengQiangDu],t2.[FWanQuQiangDu], t2.[FCeYaMinWaiGuan],t2.[FCeYaMinDianZuChiCun],t2.[FCeYaMinDianYa],t2.[FCeLouDianLiu], t2.[FCeXianXingXiShu],t2.[FCeZuiDaChongJiDianLiu],t2.[FCeJingDianRongLiang],t2.[FCeSunHaoZhengQieJiao], t2.[FCeHuiLuDianYa],t2.[FCeLangYongDianLiu],t2.[FCeNaiDianYa],t2.[FCeJueYuanDianZu],t2.[FCeZuRan], t2.[FCeKeHanXing],t2.[FCeLaShengQiangDu],t2.[FCeWanQuQiangDu],t2.[FCeShiBaoGao], t2.[客户料号] from 项目测试数据看板 As t1 INNER JOIN 报告指标项次 As t2 ON t1.[客户对应物料代码]=t2.[客户料号] where 项目编号= '13' 这段在数据库执行是可以的 —————————————————————————— Dim sql2 As String ="S elect t1.[项目编号],t1.[客户名称],t1.[物料代码],t1.[物料名称],t1.[规格型号],t1.[客户对应物料代码]," & _ "t1.[客户对应物料名称],t1.[实发数量],t1.[批号],t2.[FJianYanShuiPing],t2.[FAQLC],t2.[FAQLDF],t2.[FAQLUT]," & _ "t2.[FAQLIR],t2.[FAQLWaiGuan],t2.[FAQLYaMinDianYa],t2.[FAQLLouDianLiu],t2.[FAQLXianXingXiShu]," & _ "t2.[FAQLChongJiDianLiu],t2.[FCeDianYa],t2.[FCePinLv],t2.[FCeDianRongLiangC],t2.[FCeSunHaoDF]," & _ "t2.[FCeNaiDianYaUT],t2.[FJueYuanDianZu],t2.[FCSL],t2.[FCUSL],t2.[FCLSL],t2.[FDFSL],t2.[FDFUSL]," & _ "t2.[FDFLSL],t2.[FD],t2.[FT],t2.[FF],t2.[FD_d],t2.[FL],t2.[FWenDu],t2.[FShiDu],t2.[FYaMinWaiGuan]," & _ "t2.[FYaMinDianZuChiCun],t2.[FYaMinDianYa],t2.[FLouDianLiu],t2.[FXianXingXiShu],t2.[FZuiDaChongJiDianLiu]," & _ "t2.[FJingDianRongLiang],t2.[FSunHaoQieJiao],t2.[FHuiLuDianYa],t2.[FLangYongDianYa],t2.[FNaiDianYa]," & _ "t2.[FJueYuanDianZu_1],t2.[FZuRan],t2.[FKeHanXing],t2.[FLaShengQiangDu],t2.[FWanQuQiangDu]," & _ "t2.[FCeYaMinWaiGuan],t2.[FCeYaMinDianZuChiCun],t2.[FCeYaMinDianYa],t2.[FCeLouDianLiu]," & _ "t2.[FCeXianXingXiShu],t2.[FCeZuiDaChongJiDianLiu],t2.[FCeJingDianRongLiang],t2.[FCeSunHaoZhengQieJiao]," & _ "t2.[FCeHuiLuDianYa],t2.[FCeLangYongDianLiu],t2.[FCeNaiDianYa],t2.[FCeJueYuanDianZu],t2.[FCeZuRan]," & _ "t2.[FCeKeHanXing],t2.[FCeLaShengQiangDu],t2.[FCeWanQuQiangDu],t2.[FCeShiBaoGao]," & _ "t2.[客户料号] from 项目测试数据看板 As t1" & _ "INNER JOIN 报告指标项次 As t2 ON t1.[客户对应物料代码]=t2.[客户料号]" & _ "where 项目编号= '" & bh & "'" 这段执行就报错:无法绑定由多个部分组成的标识符"t1.批号"等等,这是什么原因?我只分行加了" & _这个啊
|
|