开发者

SSRS reading date type as nvarchar

I have created a query that uses a decimal as a paramater in SSRS. Code below (@TrueDemand) when running this on my local PC, via the Data page the query throws an error of trying to convert nvarchar to int. However when running it in Preview or ev开发者_如何学运维en publishing the report to the web it runs fine :(

SSRS reading date type as nvarchar

Its very frustrating. Any ideas?

SELECT  AD.LogDate,
    AD.Location,
    AD.FunctionDescription as Func,
    AD.Offered,
    AD.Handled,
              AD.Handled +  ((AD.Offered - AD.Handled) * @TrueDemand) as TrueDemand,
    AD.Handled30,
    AG.SignedIn,
    AG.Available,
    AG.WorkloadSecs,
    AG.FullAHTSecs

FROM        dbo.vw_ApplicationDetail_Minus15mins AD
INNER JOIN  dbo.vw_AgentGroupDetail AG ON
    AD.Logdate = AG.Logdate AND
    AD.Location = AG.Location AND
    AD.FunctionDescription = AG.FunctionDescription

WHERE AD.Logdate between @Logdate  AND dateadd(d,1,@Logdate) AND
         AD.Location = @Location AND
         AD.FunctionDescription = @Function

ORDER BY AD.Logdate


Have you tried explicitly casting to decimal all the variables on that line.

cast(AD.Handled as Decimal) + ((Cast(AD.Offered as Decimal) - Cast(AD.Handled as Decimal)) * Cast(@TrueDemand as Decimal)) as TrueDemand
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜