Crystal报告日期参数错误

本文关键字:错误 参数 日期 报告 Crystal | 更新日期: 2023-09-27 18:27:37

我正在使用Crystal Reports创建一个摘要数据报告。我试图在查询中使用from和to date参数,但它给了我以下错误:

未能从数据库中检索数据
详细信息:ADO错误代码:0x80040e10
来源:Microsoft SQL server本机客户端11.0
说明:一个或多个参数没有给定值

我正在使用的查询如下:

select X.ITEMCODE,X.[ITEM_DESCRIPTION], X.[OPENING_BALANCE],   X.[SALES], X.[TOTAL_REJECTS], 
 X.[REJECTION_DISEASES], X.[DOCDATE]
        from
        (  
        SELECT DISTINCT T0.ItemCode AS ITEMCODE, T0.ItemName AS [ITEM_DESCRIPTION],
        ISNULL((SELECT SUM(T1.OnHand) FROM OITW T1 WHERE  T1.WhsCode = 'FGS' AND 
        T1.ItemCode = T0.ItemCode),0) AS [OPENING_BALANCE],
        ISNULL((SELECT SUM(T1.[Quantity]) FROM INV1 T1 WHERE   T0.[ItemCode] = T1.[ItemCode]),0) AS [SALES] , 
        (SELECT top 1 T1.[DocDate] FROM INV1 T1 WHERE T1.DocDate BETWEEN {?FromDate} AND {?ToDate}  AND  T0.[ItemCode] = T1.[ItemCode]) AS [DOCDATE],
        ISNULL((SELECT SUM(cast(T1.[Quantity] as int))  FROM IGE1 T1 WHERE T1.DocDate BETWEEN {?FromDate} AND {?ToDate}  AND T0.[ItemCode] = T1.[ItemCode]),0) AS [TOTAL_REJECTS],
        Isnull((SELECT TOP 1 T1.[U_RejectionOthers] 
        FROM   ige1 T1 
        WHERE  T0.[itemcode] = T1.[itemcode]
        ), 0) AS [REJECTION_DISEASES]
        from OITM T0 where T0.[ItmsGrpCod] in ('104','121','122','123','124','125','126','127','129','130','134','135','136','139','140','141','142','143','144','145')
        ) X

Crystal报告日期参数错误

我不能正确地理解你,但我理解这个问题检查以下步骤1:首先,在传递值时检查您的查询,查询是否执行2:然后检查您的水晶报表参数。我认为您使用空白值作为输入参数。

3:如果选中,则表示请取消选中。。

我也遇到了类似的问题。这是我的解决方案。

重新启动报告。在运行报表之前,请连接到数据库,然后继续更新、添加或运行报表。