>I am trying to define a query in my DataSet that takes the SUM of a field and multiple it by a number.
>
>In example 1 below, I receive an error when trying to preview the data. However, example 2 works fine, but I want to be able to pass in the percent and not have it hard coded.
>
>How can I make example 1 work?
>
>
>//Example 1.
>//Does not work.
>//Error: Syntax error converting the varchar value '.247' to a column of data type int.
>SELECT <fields>,
> SUM(Forecast.total) * @lnpercent AS ytd
>
>//Example 2.
>//Works.
>SELECT <fields>,
> SUM(Forecast.total) * .247 AS ytd
>
>
>
>Thanks,
>
>Jerry
Did you try to add CAST function around the SUM ?
If it's not broken, fix it until it is.
My Blog