Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Split integer valuefrom decimal valye Rate Topic Display Mode Topic Options
Author
 Message
 Posted Monday, July 07, 2008 5:45 AM
 SSC Journeyman Group: General Forum Members Last Login: Wednesday, September 29, 2010 3:02 AM Points: 89, Visits: 53
 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
Post #529177
 Posted Tuesday, July 08, 2008 5:16 AM
 Forum Newbie Group: General Forum Members Last Login: Tuesday, November 26, 2013 7:18 AM Points: 1, Visits: 22
 Function floor() does not work?
Post #529900
 Posted Tuesday, July 08, 2008 5:31 AM
 SSC Journeyman Group: General Forum Members Last Login: Wednesday, September 29, 2010 3:02 AM Points: 89, Visits: 53
 Thanks,It is working
Post #529911
 Posted Tuesday, July 08, 2008 2:21 PM
 Old Hand Group: General Forum Members Last Login: Today @ 8:47 AM Points: 341, Visits: 2,166
 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.
Post #530358
 Posted Tuesday, July 08, 2008 2:40 PM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 8:40 AM Points: 34,535, Visits: 28,698
 indraprakash (7/7/2008)Note: We can't use convert functionThe ROUND function with the truncate option is definately the way to go... but why is it that you can't use the CONVERT function? --Jeff Moden"RBAR 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." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #530365
 Posted Tuesday, July 08, 2008 10:18 PM
 SSC Journeyman Group: General Forum Members Last Login: Wednesday, September 29, 2010 3:02 AM Points: 89, Visits: 53
 Hi,round function not gives proper output floor is right.
Post #530475
 Posted Tuesday, July 08, 2008 10:53 PM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 8:40 AM Points: 34,535, Visits: 28,698
 indraprakash (7/8/2008)Hi,round function not gives proper output floor is right.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. --Jeff Moden"RBAR 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." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #530482
 Posted Wednesday, July 09, 2008 7:54 AM
 Old Hand Group: General Forum Members Last Login: Today @ 8:47 AM Points: 341, Visits: 2,166
 I'm sorry... I meant ROUND(YourValue, 0, 1)I apologize for my lack of proof-reading.
Post #530824
 Posted Wednesday, July 09, 2008 8:09 AM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 8:40 AM Points: 34,535, Visits: 28,698
 No problem and thanks for the feedback, Phil... I've made similar mistakes... just wanted to be sure...:) --Jeff Moden"RBAR 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." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #530843
 Posted Monday, August 08, 2011 7:54 PM
 Forum Newbie Group: General Forum Members Last Login: Sunday, May 26, 2013 9:06 PM Points: 5, Visits: 40
 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
Post #1156494

 Permissions