July 18, 2018 at 9:46 am
Hello Dear Friends,
I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
Expected Correct Result: 15.17
I have tried to in TSQLSELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000
Any help will be much appreciated.
July 18, 2018 at 10:03 am
Ronnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Never mind, that was just guess without looking first.
July 18, 2018 at 10:06 am
Ronnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
July 18, 2018 at 10:10 am
Lynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick helpSELECT 15.42-(-(125-100)/)/100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000
July 18, 2018 at 10:12 am
Ronnie Rahman - Wednesday, July 18, 2018 10:10 AMLynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick help
SELECT 15.42-(-(125125--100100)/)/100100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000
I run this:
SELECT 15.42-(125-100)/100 and I get 15.17.
What you posted isn't even close to this.
July 18, 2018 at 10:20 am
Lynn Pettis - Wednesday, July 18, 2018 10:12 AMRonnie Rahman - Wednesday, July 18, 2018 10:10 AMLynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick help
SELECT 15.42-(-(125125--100100)/)/100100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000I run this:
SELECT 15.42-(125-100)/100 and I get 15.17.
What you posted isn't even close to this.
My apologies for the incorrect SQL formula
Excel Formula:
Expected Correct Result: 15.17
15.42 needs to multiply with the result of (125-100)/100 as per the Excel formula.
July 18, 2018 at 10:22 am
Ronnie Rahman - Wednesday, July 18, 2018 10:20 AMLynn Pettis - Wednesday, July 18, 2018 10:12 AMRonnie Rahman - Wednesday, July 18, 2018 10:10 AMLynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick help
SELECT 15.42-(-(125125--100100)/)/100100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000I run this:
SELECT 15.42-(125-100)/100 and I get 15.17.
What you posted isn't even close to this.My apologies for the incorrect SQL formula
Excel Formula:=15.42 * (125-100)/100Expected Correct Result: 15.17
15.42 needs to multiply with the result of (125-100)/100 as per the Excel formula.
Okay, back to what I original thought, integer arithmetic:
SELECT 15.42-(125.-100.)/100.
July 18, 2018 at 10:30 am
Lynn Pettis - Wednesday, July 18, 2018 10:22 AMRonnie Rahman - Wednesday, July 18, 2018 10:20 AMLynn Pettis - Wednesday, July 18, 2018 10:12 AMRonnie Rahman - Wednesday, July 18, 2018 10:10 AMLynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick help
SELECT 15.42-(-(125125--100100)/)/100100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000I run this:
SELECT 15.42-(125-100)/100 and I get 15.17.
What you posted isn't even close to this.My apologies for the incorrect SQL formula
Excel Formula:=15.42 * (125-100)/100Expected Correct Result: 15.17
15.42 needs to multiply with the result of (125-100)/100 as per the Excel formula.Okay, back to what I original thought, integer arithmetic:
SELECT 15.42-(125.-100.)/100.
I know this might make you upset, I have been given a wrong Excel formula from the beginning - I apologise for this.
The correct Excel formula is =15.42*(1-(125-100)/100) and the expected result is 11.57
How do you convert above formula to SQL to get 11.57?
July 18, 2018 at 10:34 am
Ronnie Rahman - Wednesday, July 18, 2018 10:30 AMLynn Pettis - Wednesday, July 18, 2018 10:22 AMRonnie Rahman - Wednesday, July 18, 2018 10:20 AMLynn Pettis - Wednesday, July 18, 2018 10:12 AMRonnie Rahman - Wednesday, July 18, 2018 10:10 AMLynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick help
SELECT 15.42-(-(125125--100100)/)/100100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000I run this:
SELECT 15.42-(125-100)/100 and I get 15.17.
What you posted isn't even close to this.My apologies for the incorrect SQL formula
Excel Formula:=15.42 * (125-100)/100Expected Correct Result: 15.17
15.42 needs to multiply with the result of (125-100)/100 as per the Excel formula.Okay, back to what I original thought, integer arithmetic:
SELECT 15.42-(125.-100.)/100.
I know this might make you upset, I have been given a wrong Excel formula from the beginning - I apologise for this.
The correct Excel formula is =15.42*(1-(125-100)/100) and the expected result is 11.57
How do you convert above formula to SQL to get 11.57?
Put a decimal point after EACH of the integer values, or at least after the last 100 in your formula. In SQL SELECT 99/100 will return 0 as the result.
July 18, 2018 at 10:40 am
Lynn Pettis - Wednesday, July 18, 2018 10:34 AMRonnie Rahman - Wednesday, July 18, 2018 10:30 AMLynn Pettis - Wednesday, July 18, 2018 10:22 AMRonnie Rahman - Wednesday, July 18, 2018 10:20 AMLynn Pettis - Wednesday, July 18, 2018 10:12 AMRonnie Rahman - Wednesday, July 18, 2018 10:10 AMLynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick help
SELECT 15.42-(-(125125--100100)/)/100100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000I run this:
SELECT 15.42-(125-100)/100 and I get 15.17.
What you posted isn't even close to this.My apologies for the incorrect SQL formula
Excel Formula:=15.42 * (125-100)/100Expected Correct Result: 15.17
15.42 needs to multiply with the result of (125-100)/100 as per the Excel formula.Okay, back to what I original thought, integer arithmetic:
SELECT 15.42-(125.-100.)/100.
I know this might make you upset, I have been given a wrong Excel formula from the beginning - I apologise for this.
The correct Excel formula is =15.42*(1-(125-100)/100) and the expected result is 11.57
How do you convert above formula to SQL to get 11.57?
Put a decimal point after EACH of the integer values, or at least after the last 100 in your formula. In SQL SELECT 99/100 will return 0 as the result.
Thank you so much for your help finally got it to work. Result as expected 11.57
select cast(15.42*(1.0-((125-100)/100.00)) as decimal(9,2))
July 18, 2018 at 11:32 am
Ronnie Rahman - Wednesday, July 18, 2018 10:40 AMLynn Pettis - Wednesday, July 18, 2018 10:34 AMRonnie Rahman - Wednesday, July 18, 2018 10:30 AMLynn Pettis - Wednesday, July 18, 2018 10:22 AMRonnie Rahman - Wednesday, July 18, 2018 10:20 AMLynn Pettis - Wednesday, July 18, 2018 10:12 AMRonnie Rahman - Wednesday, July 18, 2018 10:10 AMLynn Pettis - Wednesday, July 18, 2018 10:06 AMRonnie Rahman - Wednesday, July 18, 2018 9:46 AMHello Dear Friends,I need a help with Converting an Excel Formula below into TSQL
Excel Formula:
=15.42-(125-100)/100
Expected Correct Result: 15.17I have tried to in TSQL
SELECT 15.42 * (1- (125 - 100 )/1)/10.0
Incorrect Result :
(No column name)
-37.008000Any help will be much appreciated.
Your formula is wrong, try this:
SELECT 15.42-(125-100)/100
Hello
Thank you for your quick help
SELECT 15.42-(-(125125--100100)/)/100100
This formula gives me the incorrect result, expecting result 15.17
(No column name)
3.855000I run this:
SELECT 15.42-(125-100)/100 and I get 15.17.
What you posted isn't even close to this.My apologies for the incorrect SQL formula
Excel Formula:=15.42 * (125-100)/100Expected Correct Result: 15.17
15.42 needs to multiply with the result of (125-100)/100 as per the Excel formula.Okay, back to what I original thought, integer arithmetic:
SELECT 15.42-(125.-100.)/100.
I know this might make you upset, I have been given a wrong Excel formula from the beginning - I apologise for this.
The correct Excel formula is =15.42*(1-(125-100)/100) and the expected result is 11.57
How do you convert above formula to SQL to get 11.57?
Put a decimal point after EACH of the integer values, or at least after the last 100 in your formula. In SQL SELECT 99/100 will return 0 as the result.
Thank you so much for your help finally got it to work. Result as expected 11.57
select cast(15.42*(1.0-((125-100)/100.00)) as decimal(9,2))
The question now is.... do you understand why it now works and didn't before?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2018 at 11:36 am
Ronnie Rahman - Wednesday, July 18, 2018 10:40 AMThank you so much for your help finally got it to work. Result as expected 11.57
select cast(15.42*(1.0-((125-100)/100.00)) as decimal(9,2))
A simpler version would be
SELECT 11.57
🙂
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
July 18, 2018 at 11:39 am
Phil Parkin - Wednesday, July 18, 2018 11:36 AMRonnie Rahman - Wednesday, July 18, 2018 10:40 AMThank you so much for your help finally got it to work. Result as expected 11.57
select cast(15.42*(1.0-((125-100)/100.00)) as decimal(9,2))
A simpler version would be
SELECT 11.57
🙂
haha... I know and I wish.
July 18, 2018 at 12:03 pm
Ronnie Rahman - Wednesday, July 18, 2018 11:39 AMPhil Parkin - Wednesday, July 18, 2018 11:36 AMRonnie Rahman - Wednesday, July 18, 2018 10:40 AMThank you so much for your help finally got it to work. Result as expected 11.57
select cast(15.42*(1.0-((125-100)/100.00)) as decimal(9,2))
A simpler version would be
SELECT 11.57
🙂haha... I know and I wish.
You probably know this but need to make sure... What Phil means is that if you're not using anything but literal values, why not just use the literal value? What value will be a variable value in your formula?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply