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
 SQL Server Development (2000)
 Convert money data type

Author  Topic 

kondurupraveen
Starting Member

6 Posts

Posted - 2005-08-23 : 04:39:58
hi all,
I've used money datatype and when i retrieve the data from it to display it in a page then i get the value followed by a point and four zeros. i.e. if i have value 100 in that coloumn and when i print it in the page it is showing as 100.0000.
I've tried using convert(varchar(50),coloumnname). I'm getting the correct result i.e 100.00. But i dont know whether the procedure is correct or wrong.

the want the output as :
if input is 100 then output should be 100:00

Can plz someone help me.....anykind of response would be appreciated.
Praveen

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-23 : 04:48:00
Are you using report?
If so, you can use Report's format method to format the number
If you want to do this as SQL query then you need to convert it to decimal data type

Declare @m money
Set @m=100
select @m -- four Zeroes
Select cast(@m as decimal(12,2)) -- Two zeroes


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

kondurupraveen
Starting Member

6 Posts

Posted - 2005-08-23 : 05:50:35
Thanks Madhivanan
Go to Top of Page
   

- Advertisement -