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)
 arithmetic overflow when converting to decimal

Author  Topic 

jn-at-uk
Starting Member

20 Posts

Posted - 2005-05-18 : 05:11:25
hi,
I get the
"Arithmetic overflow error converting numeric to data type numeric."
when i do the following

declare @NConv int, @PConv decimal(2,2),@pVisit int
select @NConv = 10
select @PVisit = 587
select @PConv = convert(decimal(18,2),((1.0*@NConv/@PVisit) * 100))
@PConv = error

but if @NConv = 3 i get .51 which is correct.
How do i get an answer of

jn-at-uk
Starting Member

20 Posts

Posted - 2005-05-18 : 05:16:41
problem resolved i needed to declare @PConv decimal(4,2) instead of (2,2)
Go to Top of Page
   

- Advertisement -