Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select statement
Message
From
17/04/2008 14:31:15
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
SQL Select statement
Miscellaneous
Thread ID:
01311547
Message ID:
01311547
Views:
55
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
Next
Reply
Map
View

Click here to load this message in the networking platform