## Split integer valuefrom decimal valye

 Author Message vchandm23 Forum Newbie Group: General Forum Members Points: 6 Visits: 46 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 vchandm23 Forum Newbie Group: General Forum Members Points: 6 Visits: 46 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 Bruce W Cassidy Right there with Babe Group: General Forum Members Points: 787 Visits: 1033 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. Jeff Moden SSC-Forever Group: General Forum Members Points: 45447 Visits: 39944 vchandm23 (8/8/2011)but is there a function that does this in SQL ServerNot in any version of SQL Server that I know of. You're pretty much stuck with doing the math like you did. --Jeff ModenRBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.Although change is inevitable, change for the better is not.Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:How to post code problemsHow to post performance problemsForum FAQs krs Grasshopper Group: General Forum Members Points: 21 Visits: 185 vchandm23:What about using modulus (%)? Like some flavor of the following:select replace(1234.4321 % 1 ,'0.','')