Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select statement
Message
From
19/04/2008 20:41:28
 
 
To
17/04/2008 14:31:15
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01311547
Message ID:
01311912
Views:
18
>//Error: Syntax error converting the varchar value '.247' to a column of data type int.
>SELECT ,
> SUM(Forecast.total) * @lnpercent AS ytd


How did you define @lnpercent?

~~Bonnie





>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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform