Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
desikankannan
Posting Yak Master
152 Posts |
Posted - 2008-05-15 : 02:57:54
|
Hi,i try to multiply two variables in stored procedure it throws errorhow to multiply two variables in stored procedureCREATE PROCEDURE salarycalc_SP (@empid varchar(6),@fldothall int,@fldall int, @fldlic int,@fldwdays int,@fldothours int,@fldmonth int,@fldyear varchar(4) ) AS declare @getemp varchar(6) declare @getwages numeric(15,2) declare @getothours numeric(15,2) declare @prevType varchar(2) declare @aIntCode varchar(15) declare @getextra numeric(15,2)select @getemp =empid from tblemployee where empid = @empidselect @getwages = fldwages,@getothours = fldothour from tblbasicwages where empid = @getemp @getextra = (@fldothours) * ( @getothours) - how to multiply two valueprint @getextraGODesikankannan |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-15 : 05:05:04
|
[code]SET @getextra = @fldothours * @getothours[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
chandan_joshi80
Starting Member
30 Posts |
Posted - 2008-05-16 : 02:40:15
|
@getextra = (@fldothours) * ( @getothours)IT GENERATE SYNTAX ERROR.USE SET TO ASSIGN VALUE TO A VARIALBLEchandan Joshi |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-17 : 03:17:43
|
quote: Originally posted by chandan_joshi80 @getextra = (@fldothours) * ( @getothours)IT GENERATE SYNTAX ERROR.USE SET TO ASSIGN VALUE TO A VARIALBLEchandan Joshi
Was harsh telling a different solution one day before? |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-05-17 : 08:43:17
|
quote: Originally posted by chandan_joshi80 @getextra = (@fldothours) * ( @getothours)IT GENERATE SYNTAX ERROR.USE SET TO ASSIGN VALUE TO A VARIALBLEchandan Joshi
The error message is very obvious MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|