November 2, 2011 at 8:59 am
I am sure what I am doing wrong is very simple, I just cant seem to figure this out. Why does this:
SELECT 2670*(1-(30/100))
NOT equal this: 1869 (which is the result if you enter the above math problem in your calculator)
Any and All help will be greatly appreciated.
November 2, 2011 at 9:06 am
Because you're dividing two integers and not two decimals.
30/100 = 0
30/100. = .3
SELECT 30/100, 30/100.
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgNovember 2, 2011 at 9:08 am
Thanks for the reply, I ended up getting it with this:
SELECT (2670*(1-(convert(decimal(18,2),30)/100)))
Thanks Again.
November 2, 2011 at 9:17 am
Although adding a simple "." does the same. 🙂
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgViewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply