简体   繁体   中英

Crystal Reports Date Parameter Error

I am creating a summary data report using Crystal Reports. I tried to use from and to date parameter in my query, but it is giving me the following error:

Failed to retrieve data from database.
Details: ADO Error Code: 0x80040e10
Source: Microsoft SQL server native client 11.0
Description: No value given for one or more parameters

My query which i am using is given below:

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

I can't get you correctly, but i understand the problem check the following steps 1:At First check your query when passing the vale the query gets executed or not 2:Then check your crystal report parameters. i think you use the blank values for your input parameters.

3:if it check it means please uncheck that..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM