﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / Decimal Truncation in division / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 13:23:05 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Decimal Truncation in division</title><link>http://www.sqlservercentral.com/Forums/Topic870096-392-1.aspx</link><description>[quote][b]Hariprasad.M (2/22/2010)[/b][hr]Thanks paul, that was good one.[/quote]No worries, Hari - I enjoyed writing the reply.  It would be cool if you would just post your questions in one forum from now on though ;-)</description><pubDate>Mon, 22 Feb 2010 22:53:36 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Decimal Truncation in division</title><link>http://www.sqlservercentral.com/Forums/Topic870096-392-1.aspx</link><description>Thanks paul, that was good one. regardsHari</description><pubDate>Mon, 22 Feb 2010 22:45:14 GMT</pubDate><dc:creator>Hariprasad.M</dc:creator></item><item><title>RE: Decimal Truncation in division</title><link>http://www.sqlservercentral.com/Forums/Topic870096-392-1.aspx</link><description>[color="#FF0000"][b]Duplicate thread.[/b][/color]I posted a comprehensive answer here:[u][url]http://www.sqlservercentral.com/Forums/Topic870098-338-1.aspx[/url][/u]</description><pubDate>Mon, 22 Feb 2010 07:49:26 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Decimal Truncation in division</title><link>http://www.sqlservercentral.com/Forums/Topic870096-392-1.aspx</link><description>Hi, Try this,SELECT CAST(CAST(1.67574 AS DECIMAL(38,10)) / CAST(10000 AS DECIMAL(38,10)) AS DECIMAL(38,10)) conv_factorSQL server taking a default scale, you need to explicitly specify the precision and scale.regardsHari</description><pubDate>Mon, 22 Feb 2010 05:50:57 GMT</pubDate><dc:creator>Hariprasad.M</dc:creator></item><item><title>Decimal Truncation in division</title><link>http://www.sqlservercentral.com/Forums/Topic870096-392-1.aspx</link><description>HiLook at these SELECT statements.1. SELECT  CAST(1.67574 AS DECIMAL(38,10))  A, CAST(10000 AS DECIMAL(38,10))  B2. SELECT  CAST(1.67574 AS DECIMAL(38,10)) / CAST(10000 AS DECIMAL(38,10)) conv_factorWhen first statement is run the result isA                       B1.6757400000	10000.0000000000But, when the second one runs, the result is conv_factor0.000167Both the numbers are converted into DECIMAL(38,10) before the division, but, why did this truncation occured?</description><pubDate>Mon, 22 Feb 2010 00:02:56 GMT</pubDate><dc:creator>dutt</dc:creator></item></channel></rss>