How can we achieve excel ceiling function with significance value in SQL Server

0 votes

How can we apply excel ceiling function with significance value in SQL server ?

=Ceiling(10,3) 

it should return 12, because 12 is roundup nearest to 3

=Ceiling(36,7) 

it should return 42, because 42 is roundup nearest to 7

Apr 1, 2022 in Database by Edureka
• 13,690 points
976 views

1 answer to this question.

0 votes
If the underlying data types and rounding functions are not understood, rounding can be misconstrued. The rounded value varies depending on the data type (integer, float, decimal, etc.). Furthermore, the numbers can differ depending on the SQL Server rounding function (ROUND(), CEILING(), FLOOR()) used in the calculation. As a result, it's critical to determine the user's rounding requirements before translating them into the proper T-SQL statement.

Let's start with a definition for mathematical functions:

ROUND - Rounds a positive or negative value to a specified length, accepting one of three values:
To round the value

Numbers can be positive or negative.

This data type can be int (small, medium, large), decimal, numeric, money, or smallmoney.

When rounding, be precise.

On the right side of the decimal point, a positive number rounds.

On the left side of the decimal point, a negative number rounds.

When this value is not 0 or not included, the value is truncated to round.

CEILING - Evaluates the right-hand decimal value and returns the smallest integer greater than or equal to the specified numeric expression, accepting only one value:

To round the value

FLOOR - Evaluates the right-hand decimal value and returns the largest integer less than or equal to the specified numeric expression, accepting only one value:
To round the value
answered Apr 4, 2022 by gaurav
• 23,260 points

Related Questions In Database

0 votes
1 answer

What are the different authentication modes in SQL Server? How can it be changed?

Windows mode and Mixed Mode – SQL ...READ MORE

answered Oct 29, 2018 in Database by Sahiti
• 6,370 points
1,208 views
0 votes
1 answer

How Can I use "Date" Datatype in sql server?

There's problem in all of them and ...READ MORE

answered Feb 9, 2022 in Database by Neha
• 9,020 points
1,346 views
0 votes
1 answer

How can I calculate deciles with a range of 12,000 cells in excel?

1. Enter the following formula in cell ...READ MORE

answered Mar 25, 2022 in Database by gaurav
• 23,260 points
8,814 views
0 votes
1 answer

How can we perform common set operations (union, intersection, minus) in MS Excel?

The MATCH function can be used as ...READ MORE

answered Mar 31, 2022 in Database by gaurav
• 23,260 points
1,882 views
0 votes
0 answers

How can I show the table structure in SQL Server query?

Query: SELECT DateTime, Skill, Name, TimeZone, ID, User, ...READ MORE

Aug 11, 2022 in Database by Kithuzzz
• 38,000 points
787 views
0 votes
0 answers

How can I delete using INNER JOIN with SQL Server?

In SQL Server 2008, I want to ...READ MORE

Aug 23, 2022 in Database by Kithuzzz
• 38,000 points
800 views
0 votes
0 answers

How to make a query with group_concat in sql server ?

I am aware that the Group Concat ...READ MORE

Aug 28, 2022 in Database by Kithuzzz
• 38,000 points
727 views
0 votes
0 answers

How to DROP multiple columns with a single ALTER TABLE statement in SQL Server?

In one ALTER TABLE statement, I would ...READ MORE

Sep 2, 2022 in Database by Kithuzzz
• 38,000 points
748 views
0 votes
1 answer

how do I calculate discount with if function in excel?

Suppose a customer gets a 10 percent ...READ MORE

answered Feb 23, 2022 in Database by gaurav
• 23,260 points
11,312 views
0 votes
1 answer

how do I calculate discount with if function in excel

Notes about the release; Frameworks to aim ...READ MORE

answered Mar 25, 2022 in Database by gaurav
• 23,260 points
731 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP