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)
 How can i make this selection

Author  Topic 

anupalavila
Yak Posting Veteran

56 Posts

Posted - 2009-03-25 : 01:47:10
Hai
In my table I have a field amt which is numeric with length 9 and scale 2 , in it I have values like
300.00
245.45
569.00
222.23

How can I make selection such that I can get values such as
300
245.45
569
222.23

ie, if the decimal portion is .00 avoid the decimal portion

Thanks and Regards
Anu Palavila

sunil
Constraint Violating Yak Guru

282 Posts

Posted - 2009-03-25 : 02:12:25
Its advisable that formatting is done in front end.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-25 : 03:29:16
quote:
Originally posted by anupalavila

Hai
In my table I have a field amt which is numeric with length 9 and scale 2 , in it I have values like
300.00
245.45
569.00
222.23

How can I make selection such that I can get values such as
300
245.45
569
222.23

ie, if the decimal portion is .00 avoid the decimal portion

Thanks and Regards
Anu Palavila


Where do you want to show data?

Madhivanan

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

anupalavila
Yak Posting Veteran

56 Posts

Posted - 2009-03-25 : 04:04:36
I am trying to show the data in report.rdlc doc in .Net 2005

Thanks and Regards
Anu Palavila
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-03-25 : 10:05:09
Try this..

SELECT REPLACE(CONVERT(VARCHAR,amt),'.00','') from urtable
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-03-25 : 10:06:50
or even just

SELECT REPLACE(amt,'.00','') from urtable
Go to Top of Page
   

- Advertisement -