﻿<?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 7,2000 / SQL Server CE  / Split integer valuefrom decimal valye / 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>Thu, 23 May 2013 23:43:41 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>vchandm23:What about using modulus (%)?  Like some flavor of the following:select  replace(1234.4321  % 1 ,'0.','')</description><pubDate>Tue, 09 Aug 2011 11:31:38 GMT</pubDate><dc:creator>krs</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>[quote][b]vchandm23 (8/8/2011)[/b][hr]but is there a function that does this in SQL Server[/quote]Not in any version of SQL Server that I know of.  You're pretty much stuck with doing the math like you did.</description><pubDate>Mon, 08 Aug 2011 22:03:53 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>If you can't use convert(), you can always use cast().  BTW, I can't remember how floor() behaves for negative numbers, but I know there's a reason I end up using round() instead.</description><pubDate>Mon, 08 Aug 2011 21:36:44 GMT</pubDate><dc:creator>Bruce W Cassidy</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>i know i can do the floor() on a decimal number and then store that to a variable and subtract it from the original numberexample @a = 2.75@b = floor(2.75)@c = @a - @b (this gives me  0.75)but is there a function that does this in SQL ServerCheers,Chandra</description><pubDate>Mon, 08 Aug 2011 20:16:02 GMT</pubDate><dc:creator>vchandm23</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>i know i can do the floor() on a decimal number and then store that to a variable and subtract it from the original numberexample @a = 2.75@b = floor(2.75)@c = @a - @b (this gives me  0.75)but is there a function that does this in SQL ServerCheers,Chandra</description><pubDate>Mon, 08 Aug 2011 20:15:08 GMT</pubDate><dc:creator>vchandm23</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>What if i want the other value not the floor value ........... i mean if its  1234.4321 i want 4321 (values after the decimal place...)?Cheers,Chandra</description><pubDate>Mon, 08 Aug 2011 19:54:23 GMT</pubDate><dc:creator>vchandm23</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>No problem and thanks for the feedback, Phil... I've made similar mistakes... just wanted to be sure...:)</description><pubDate>Wed, 09 Jul 2008 08:09:13 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>I'm sorry... I meant ROUND(YourValue, 0, 1)I apologize for my lack of proof-reading.</description><pubDate>Wed, 09 Jul 2008 07:54:48 GMT</pubDate><dc:creator>PhilPacha</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>[quote][b]indraprakash (7/8/2008)[/b][hr]Hi,round function not gives proper output floor is right.[/quote]Ummmm.... why do you think that?  Using the optional 3rd parameter of ROUND makes it behave like FLOOR but with more control, if you need it.</description><pubDate>Tue, 08 Jul 2008 22:53:26 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>Hi,round function not gives proper output floor is right.</description><pubDate>Tue, 08 Jul 2008 22:18:40 GMT</pubDate><dc:creator>indraprakash</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>[quote][b]indraprakash (7/7/2008)[/b][hr]Note: We can't use convert function[/quote]The ROUND function with the truncate option is definately the way to go... but why is it that you can't use the CONVERT function?</description><pubDate>Tue, 08 Jul 2008 14:40:42 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>or, useROUND(YourValue, 1)    (revised)  I'm sorry... I meant ROUND(YourValue, 0, 1)I apologize for my lack of proof-reading.The non-zero 2nd parameter truncates the value, without changing the datatype.</description><pubDate>Tue, 08 Jul 2008 14:21:27 GMT</pubDate><dc:creator>PhilPacha</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>Thanks,It is working</description><pubDate>Tue, 08 Jul 2008 05:31:26 GMT</pubDate><dc:creator>indraprakash</dc:creator></item><item><title>RE: Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>Function floor() does not work? :unsure:</description><pubDate>Tue, 08 Jul 2008 05:16:44 GMT</pubDate><dc:creator>ralfik</dc:creator></item><item><title>Split integer valuefrom decimal valye</title><link>http://www.sqlservercentral.com/Forums/Topic529177-137-1.aspx</link><description>Hi All,I want to split integer part from decimal value e.g.   i have a no is 12456324.254 and i want to the output is 12456324Note: We can't use convert function</description><pubDate>Mon, 07 Jul 2008 05:45:10 GMT</pubDate><dc:creator>indraprakash</dc:creator></item></channel></rss>