Round() function in SQL Server

Round():-This function is used to round a numeric field to the number of decimals specified.

Syntax:-

    ROUND ( numeric_expression , length [ ,function ]

numeric_expression :-Expression of the exact numeric or approximate numeric data type category, except for the bit data type.

length:- Optional.Must be an expression of type tinyint, smallint, or int. When length is a positive number, numeric_expression is rounded to the number of decimal positions specified by length. When length is a negative number, numeric_expression is rounded on the left side of the decimal point, as specified by length.

function:-Function must be tinyint, smallint, or int. When function is omitted or has a value of 0 (default), numeric_expression is rounded. When a value other than 0 is specified, numeric_expression is truncated.

Examples:-

1) Select Round(234.32,-3)
Result:-
0.00

2) Select Round(234.32,-2)
Result:-
200.00

3) Select Round(234.32,-1)
Result:-
230.00

4) select Round(234.32,0)
Result:-
234.00

5) Select Round(234.32,1)
Result:-
234.30

6) Select Round(234.32, 2)
Result:-
234.32

7) Select Round(234.32,3)
Result
234.32

DMCA.com

About vivekjohari

Database Consultant with more than 11.5 years of experience in database designing & programming and DBA related activities.  Had good experience on different databases like SQL Server, MySQL & Oracle, Azure SQL &  Big Data.
This entry was posted in SQL Functions, SQL Server and tagged . Bookmark the permalink.

31 Responses to Round() function in SQL Server

  1. Pingback: Dentist in Abilene Texas

  2. Pingback: ขายฝาก ที่ดิน คือ อะไร

  3. Pingback: roofing companies rhode island

  4. Pingback: GCLUB

  5. Pingback: Electricity Companies near me

  6. Pingback: แบบ บ้าน พร้อม แปลน

  7. Pingback: tree service nashville tn

  8. Pingback: Charlotte Johansson

  9. Pingback: Rage quit

  10. Pingback: increase google rank

  11. Pingback: Togelsumo

  12. Pingback: บาคาร่า

  13. Pingback: 바카라사이트

  14. Pingback: รักษาหลุมสิว

  15. Pingback: ศัลยกรรมเกาหลี

  16. Pingback: Beverly Hills 90210 Season 10 fmovies

  17. Pingback: 바카라사이트

  18. Pingback: road cases decals

  19. Pingback: ทิงเจอร์ขาว

  20. Pingback: botox

  21. Pingback: scam

  22. Pingback: Investments in Nigeria

  23. Pingback: CBD oil

  24. Pingback: copy Hublot Chronograph

  25. Pingback: how to lose weight fast

  26. Pingback: Tochka Market

  27. Pingback: Cryptonia Market Exit Scam

  28. Pingback: https://novushub.com/hindi-gana-video/

  29. Pingback: partenariat influenceur

  30. Pingback: แทงบอลออนไลน์

  31. Pingback: cdr qq

Leave a Reply