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