CrystalReport中的选择命令出现问题-错误"IErrorInfo.GetDescription失败,出现E_FAIL(0x80004005)" [英] problem with select command in CrystalReport - error "IErrorInfo.GetDescription failed with E_FAIL(0x80004005)"

查看:129
本文介绍了CrystalReport中的选择命令出现问题-错误"IErrorInfo.GetDescription失败,出现E_FAIL(0x80004005)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我的水晶报表中的select命令有问题.我需要根据另一个字段的值使用不同名称的表的一个字段.
我有以下代码:

Hello,

I have problem with the the select command in my crystal report. I need to use one field of the table under different names depending on the value of another field.
I have this code:

SELECT 
[NOVI.GBR as gbrnov], 
[NOVI.AB as abnov], 
[NALOG1.DATA as datanov],
[Min(NALOG1.POCKM) AS MinOfPOCKM], 
[Max(NALOG1.KRAJKM) AS MaxOfKRAJKM],
[(Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA], 
[(MAGACIN.KOL)/100 AS Potr100km], 
[MAGACIN.SIFRA], 
[(case when [MAGACIN.SIFRA]='0991000' then [MAGACIN.KOL] else null end as 'Gorivo'], 
[(case when [MAGACIN.SIFRA]='0993050' then [MAGACIN.KOL] else null end as 'Maslo'], 
[NOVI.DATAP AS poslprov], 
[NOVI.DATAS AS poslservis] 
FROM 
(NALOG1 INNER JOIN MAGACIN ON NALOG1.GBRV=MAGACIN.GBR) INNER JOIN NOVI ON NALOG1.GBRV=NOVI.GBR where ( ( ( (NOVI.GBR)>=? And (NOVI.GBR)<=? ) ) AND ( (NOVI.AB)=? or (NOVI.AB)=?) AND ( ( (NALOG1.DATA)>=?) and ((NALOG1.DATA)<=?) ) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, NOVI.DATAP, NOVI.DATAS



并得到错误IErrorInfo.GetDescription失败,错误代码为E_FAIL(0x80004005)
有人可以帮我吗,我很绝望,不知道该怎么办.



and get the error IErrorInfo.GetDescription failed with E_FAIL(0x80004005)
Can anybody help me please, I am desperate and don''t know what to do with this.

推荐答案

看起来您的查询中有一些保留字.我建议您将table.field替换为[table].[field]
试试这个

It looks that there is some reserved words in your query. I suggest you replace table.field by [table].[field]
try this

SELECT 
[NOVI].[GBR] as gbrnov, 
[NOVI].[AB] as abnov, 
[NALOG1].[DATA] as datanov,
Min([NALOG1].[POCKM]) AS MinOfPOCKM, 
Max([NALOG1].[KRAJKM]) AS MaxOfKRAJKM,
Max([NALOG1].[KRAJKM])-Min([NALOG1].[POCKM]) AS RAZLIKA, 
([MAGACIN].[KOL])/100 AS Potr100km, 
[MAGACIN].[SIFRA], 
case when [MAGACIN].[SIFRA]='0991000' then [MAGACIN].[KOL] else null end as 'Gorivo', 
case when [MAGACIN].[SIFRA]='0993050' then [MAGACIN].[KOL] else null end as 'Maslo', 
[NOVI].[DATAP] AS poslprov, 
[NOVI].[DATAS] AS poslservis 
FROM 
(NALOG1 INNER JOIN MAGACIN
ON [NALOG1].[GBRV] =[MAGACIN].[GBR])
INNER JOIN [NOVI] ON [NALOG1].[GBRV] = [NOVI].[GBR] where
( ( ( ([NOVI].[GBR])>=? And ([NOVI].[GBR])<=? ) )
AND ( ([NOVI].[AB])=? or ([NOVI].[AB])=?)
AND ( (([NALOG1].[DATA])>=?)
and (([NALOG1].[DATA])<=?) ) )
GROUP BY [NOVI].[GBR], [NOVI].[AB], [NALOG1].[DATA], [NOVI].[DATAP], [NOVI].[DATAS]


这篇关于CrystalReport中的选择命令出现问题-错误"IErrorInfo.GetDescription失败,出现E_FAIL(0x80004005)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆