Reply to Re: Conversion Probs..

Your name:

Reply:


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
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация