Solved

t-sql decimal symbol error

Posted on 2009-04-06
2
388 Views
Last Modified: 2012-05-06
Hello Experts,
I have checked my regional settings and decimal seperator is (.)
But there are many records that consists decimal separator (,) in my database table. How can I format this rows as (.)
I mean when I try to run
select SUM(AccInvQty) from ItemDetails
then I get the wrong result. Because number format is wrong
Please help
0
Comment
Question by:innocent1973
2 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 500 total points
Comment Utility
Hi,

Is AccInvQty a charfield? Then you could use select sum(cast(replace(AccInvQty,',','.') as decimal)) from ItemDetails. Otherwise can you show us your error?

/peter
0
 
LVL 12

Expert Comment

by:udayakumarlm
Comment Utility
1) solve the problem of . or , : you have to check your application that is generating the rows. if the application is using the system settings then if one of the systems is configured to use , then you will get this. if you are using .Net applicaiton to access the DB then use the culterinfo for hadling the . or , issues
2) correcting the existing data :
update ItemDetails set AccInvQty=replace(AccInvQty,',','.')
3)use the query given by pivar if you don;y want to correct the DB
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now