Link to home
Start Free TrialLog in
Avatar of fahVB
fahVB

asked on

convert function help plese

I am trying to use this function and it is throwing error, i tried it two different ways but getting two different errors, any ideas...

First:
 
Cast(CAST(e.currentintrate as varchar(20))* CAST(e.currentprinbal as varchar(20)) * (30))/((360)*(100))) as VARCHAR(50)) as AINTINC,
Msg 1035, Level 15, State 10, Line 22 
Incorrect syntax near 'Cast', expected 'AS'.
 
Second:
 
convert(varchar, Cast((AINTRATE*AAVGBALA*(30))/((360)*(100)) as  money)) as AINTINC,
 
Msg 8117, Level 16, State 1, Line 9
Operand data type varchar is invalid for multiply operator.

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fahVB
fahVB

ASKER

currentbalance      smallmoney
currentintrate      varchar(6)      
Avatar of fahVB

ASKER

great, thanks