select convert(decimal(5,2),(7058/7482)*100 ,0) is showing .00 value in sql server 2000. Why ?

How to retrive value with decimal part, plz. guide me.

Thanks & Regards
Girish

Hi,

try this one ...

declare @P1 as decimal
,@p2 as decimal
set @P1=7058
set @p2=7482
select convert(decimal(5,2),(@p1/@p2)*100 ,0)

Hi,

Or add .0 to the numbers: select convert(decimal(5,2),(7058.0/7482.0)*100 ,0)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.