G
ganh
Unregistered / Unconfirmed
GUEST, unregistred user!
关于SQL语句执行的问题----can't use empty object or colunm names.user a single space if necessary (300分)<br />我有一句SQL语句,在SQL SERVER 的 Query Analyzer 中可以执行 ,但在delhpi中不能执行
提示’can't use empty object or colunm names.user a single space if necessary '
请问如何在程序中将该语句赋值给 adoquery.sql.text 才可以得到结果??
另:很有可能是双引号的问题。
select branch.code as 分公司代码,branch.name as 分公司,fixtype as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
group by branch.code,branch.name,fixtype
union
Select branch.code as 分公司代码,branch.name as 分公司 ,"合计" as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
group by branch.name,branch.code
union
Select "" as 分公司代码,"小计" as 分公司 ,fixtype as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
group by fixtype
union
Select "" as 分公司代码,"总计" as 分公司 ,"" as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
order by branch.code desc
提示’can't use empty object or colunm names.user a single space if necessary '
请问如何在程序中将该语句赋值给 adoquery.sql.text 才可以得到结果??
另:很有可能是双引号的问题。
select branch.code as 分公司代码,branch.name as 分公司,fixtype as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
group by branch.code,branch.name,fixtype
union
Select branch.code as 分公司代码,branch.name as 分公司 ,"合计" as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
group by branch.name,branch.code
union
Select "" as 分公司代码,"小计" as 分公司 ,fixtype as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
group by fixtype
union
Select "" as 分公司代码,"总计" as 分公司 ,"" as 维修类型,count(recordcode) as 合计
from record,branch
where branch.name=record.branch
order by branch.code desc