473,225 Members | 1,305 Online

# round to nearest WHOLE number

T-SQL:
How to round to the nearest WHOLE number ?

so
from -- to
-------------
170 --170
96.58 --97

thanks

Nov 16 '06 #1
1 70530
Here are a couple of ways

SELECT ROUND(170,0)
SELECT ROUND(96.58,0)

SELECT CAST(170 AS DECIMAL(10,0))
SELECT CAST(96.58 AS DECIMAL(10,0))

Nov 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

### Similar topics

 2 by: Andy | last post by: Could anyone tell me how to round off a number to certain significant figures using C++? For example, how to round off a number 12567 to 13000 (2 significant figures)? 3 by: David Marsh | last post by: The program calculates the continued fraction representation of the input: #include #include int main(int argc, char* argv) { double diff, n, r, i; if(argc != 2)... 3 by: cj | last post by: Is there a function or method that would round a long number (always up) to the next integer? 6 by: le0 | last post by: Hi Guys, Can you help me with this? Is there any function that I can use in getting a whole number Example: Input OutPut 12.3 12 1.63 1 5 by: John | last post by: Which variable type (c#) can whole the largest whole number? I know this sounds silly but as double and decimal are made for numbers with decimals I am not sure. Also if anybody knows of any... 3 by: blazinjoe1 | last post by: Hey guys, would you mind helping me with the following When i calculate a percentage the answer for example comes out like this.. 57.142857142857142857142857140% Want to round this off to a... 6 by: jasjas | last post by: my Q is like this, i want to design a calculation which use the number user enter to "/" by 100. so , offcouse the result mayb in double or integer. after that my calculation just wanna user... 1 by: mertoman | last post by: Hello, In Adobe LiveCycle Designer 8 I have a form field that users should be able to us to enter a whole number followed by a fraction or a decimal number such as: 45 1/8 or 45.125 I... 1 by: Andrea Robinson | last post by: Hello! I need a little more help. I have managed to convert all my chars input from a text file into digits. Example: Input from file: \$1,9,56#%34,9 !4.23#\$4,983 Output: 1956 349 423 4983 1 by: isladogs | last post by: The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike... 0 by: VivesProcSPL | last post by: Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for... 3 by: isladogs | last post by: The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In... 2 by: jimatqsi | last post by: The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art... 0 by: fareedcanada | last post by: Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like... 0 by: stefan129 | last post by: Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific... 0 by: egorbl4 | last post by: Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ... 1 by: davi5007 | last post by: Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the... 0 by: MeoLessi9 | last post by: I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....