|
Posted by Dan Guzman on 06/07/05 16:01
> Arithmetic overflow error converting expression to data type int.
This error message provides the clue as to the underlying cause. You get an
integer result when you multiply 2 integers (1163436036*100) before the
CONVERT. You'll get a numeric(36, 2) result if you CONVERT or CAST at least
one of the values to numeric(36, 2):
SELECT CONVERT(numeric(36,2), 1163436036)*100
SELECT CAST(1163436036 AS numeric(36,2))*100
Since both of the values are integers, you might consider using bigint
instead of numeric if your are using SQL Server 2000:
SELECT CONVERT(bigint, 1163436036)*100
SELECT CAST(1163436036 AS bigint)*100
--
Hope this helps.
Dan Guzman
SQL Server MVP
<arijitchatterjee123@yahoo.co.in> wrote in message
news:1118148077.784344.140590@g43g2000cwa.googlegroups.com...
> Hi Group,
> I am trying to display the multiplication through this way
> ----------------------
> select 1163436036*100
> ----------------------
> Getting the error
> ============================
> Server: Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.
> ============================
> For that reason I was tried to convert that to nvarchar
> ------------------------
> select convert(numeric(36,2),1163436036*100)
> ------------------------
> But still getting the error
> =============================
> Server: Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.
> =============================
> Please help me to solve it out..
> Thanks and Regards
> Arijit Chatterjee
>
Navigation:
[Reply to this message]
|