Re: Simple Math Question
- From: "Arnie Rowland" <arnie@xxxxxxxx>
- Date: Wed, 26 Jul 2006 08:40:41 -0700
As you discovered, it was doing integer division -resulting in a division
result of zero [0]. Adding a [.0] to either operand makes it work.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Phil" <Phil@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:07C74F44-C283-42E4-9F54-1DF2ED23B82F@xxxxxxxxxxxxxxxx
I have fixed this now by changing one of the figures to a Float type.
Thanks PD
"Phil" wrote:
Hi,
Hope someone can help with something so silly and that I feel quite
ashamed
about asking, I am just doing some simple percentage calcualtions which I
have done in sql before without any problems, my query simplified is as
follows
SELECT 50 /175 * 100
If you do this on a calculator you get 28.57 ignoring the trailing
figures,
if you run the above query you get ' 0 '. I am running SQL Server 2000
&
2005 and I get the same results. I am sure I am just doing something
silly
but if anyone can help it would be much appreciated.
Thanks PD
.
- Prev by Date: DHCP errors after installing SQL server 2005
- Next by Date: Full Text File Locations - Best Practices
- Previous by thread: DHCP errors after installing SQL server 2005
- Next by thread: Full Text File Locations - Best Practices
- Index(es):
Relevant Pages
|
|