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
 General SQL Server Forums
 New to SQL Server Programming
 Find out data with more than 2 decimal places

Author  Topic 

shiyam198
Yak Posting Veteran

94 Posts

Posted - 2010-07-03 : 14:00:20
Hi,

I can't think of a way to find the records that has more than 2 characters after the decimal point in a column.
this column is of "money" type.

There are some values in this column that has values like 12.1233343, etc. I need to find those records that has more than 2 decimal places.

I used several functions. I am getting type conversion errors and stuff.

Can any one know a viable solution?

Thanks,
Shiyam

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-07-03 : 14:24:24
WHERE FLOOR(SomeColumn*100)!=SomeColumn*100

--
Gail Shaw
SQL Server MVP
Go to Top of Page

shiyam198
Yak Posting Veteran

94 Posts

Posted - 2010-07-03 : 14:56:47
Thanks a lot. It works fine.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-05 : 03:35:31
quote:
Originally posted by shiyam198

Hi,

I can't think of a way to find the records that has more than 2 characters after the decimal point in a column.
this column is of "money" type.

There are some values in this column that has values like 12.1233343, etc. I need to find those records that has more than 2 decimal places.

I used several functions. I am getting type conversion errors and stuff.

Can any one know a viable solution?

Thanks,
Shiyam



Note that money has maximum of four decimal places so it is not possible to have that much decimal places

Madhivanan

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

- Advertisement -