本文介绍了获取System.Data.OleDb.OleDbException(0x80040E14):查询表达式异常中的语法错误(缺少运算符)异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cmdselect.CommandText = "select PD.Prod_ID,PD.Prod_BrandName, PD.Prod_ModelNo,sum(iif(Isnull(PM.Prod_Qty), 0, PM.Prod_Qty)) as Purchase_Item,sum(iif(Isnull(SM.Prod_Qty), 0, SM.Prod_Qty)) as Sale_Item,sum(iif(Isnull(PM.Prod_Qty), 0, PM.Prod_Qty))-  sum(iif(Isnull(SM.Prod_Qty), 0, SM.Prod_Qty)) as Balance_Item from tbl_ProductDetails PD left join tbl_PurchaseMaster PM on [PD.Prod_ID]=[PM.Prod_ID] left join tbl_SaleMaster SM on [PD.Prod_ID]=[SM.Prod_ID] group by PD.Prod_ID,PD.Prod_ModelNo,PD.Prod_BrandName";


$在[PD.Prod_ID] = [SM.Prod_ID]组上加入tbl_SaleMaster SM b $ b

im使用此查询从Access数据库表中检索数据,但我得到此错误,所以PLZ帮助我...



错误消息是: -



查询表达式中的语法错误(缺少运算符)'[PD.Prod_ID] = [PM.Prod_ID]左侧连接tbl_SaleMaster SM [PD .Prod_ID] = [SM.Prod_ID]''。



i m using this query to retrive data from Access database table but i m getting this error so plz help me...

error message is :-

"Syntax error (missing operator) in query expression ''[PD.Prod_ID]=[PM.Prod_ID] left join tbl_SaleMaster SM on [PD.Prod_ID]=[SM.Prod_ID]''."

推荐答案

... from tbl_ProductDetails PD left join tbl_PurchaseMaster PM on PD.Prod_ID=PM.Prod_ID left join tbl_SaleMaster SM on PD.Prod_ID=SM.Prod_ID ...






OR

from tbl_ProductDetails PD left join tbl_PurchaseMaster PM on PD.[Prod_ID]=PM.[Prod_ID] left join tbl_SaleMaster SM on PD.[Prod_ID]=SM.[Prod_ID]





整个列名周围的方括号可能会令人困惑,没有参考他们来自哪个表。



Square brackets around the whole columname might be confusing and have no reference which table they are from.


这篇关于获取System.Data.OleDb.OleDbException(0x80040E14):查询表达式异常中的语法错误(缺少运算符)异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 18:40