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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 store procedure multiply variables

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 error
how to multiply two variables in stored procedure

CREATE 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 = @empid
select @getwages = fldwages,@getothours = fldothour from tblbasicwages where empid = @getemp

@getextra = (@fldothours) * ( @getothours) - how to multiply two value
print @getextra

GO

Desikankannan

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-05-15 : 05:05:04
[code]SET @getextra = @fldothours * @getothours[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

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 VARIALBLE

chandan Joshi
Go to Top of Page

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 VARIALBLE

chandan Joshi


Was harsh telling a different solution one day before?
Go to Top of Page

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 VARIALBLE

chandan Joshi


The error message is very obvious

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -