August 2, 2019 at 7:17 pm
How do you convert a Data field that is feet to miles on a expression.
For instance the name of the field is PipeLen.value
August 3, 2019 at 8:26 am
According to CalculateMe.com the length of a mile is 0.00018939394 feet.
The SSRS expression to do this is:
=Fields!PipeLen.Value * 0.00018939394
Best,
Andrew
August 7, 2019 at 7:41 am
Since 1 mile is 5280 feet and your field is storing the data in feet, just divide your field by 5280.
When you divide 1 by 5280 you get .000189393 with the 93 repeating to infinity, so to use multiplication to get your answer, you lose accuracy. Ex. Working with a 10 digit decimal, 5280 * .0001893934 = 1.0000000032, whereas 5280 / 5280 = 1.
August 7, 2019 at 11:43 am
Don't forget to use floating-point math, not integer math, when you're dividing by 5280.
For example, 660 feet is 1/8 of a mile.
SELECT 660/5280
SELECT 660/5280.0
The result of the first statement is 0 because it is using integer math and it rounds to the nearest integer result
The result of the second statement is the expected value of 0.125
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply