Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert length to miles


MILES
 
Updated: 01 December 2008 

Use MILES to convert from fathoms, feet, furlongs, inches, meters, miles, nautical miles, pica, points, or yards to miles.
Syntax
SELECT [westclintech].[wct].[MILES] (
  <@Length, float,>
 ,<@From_scale, nvarchar(4000),>)
Arguments
@Length
is any real number. @Length is an expression of type float or of a type that can be implicitly converted to float
@From_scale
is the description of the units for @Length. @From_scale must be a valid value as specified in length unit representations@From_scale must be of a data type that is implicitly convertible to varchar.
 
Return Types
float
Remarks
·         The following table is a representation of the conversion of one of the length units of measure into miles:
inches
0.0000157828283
feet
0.0001893939390
yards
0.0005681818180
meters
0.0006213711920
fathoms
0.0011363636400
furlongs
0.1250000000000
miles
1.0000000000000
nautical miles
1.1507794500000
pica
0.0000026304714
points
0.0000002
 
·         Conversion of meters includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.
Example
 
select wct.MILES(100, 'yd')
Here is the result set
----------------------
0.0568181818181818
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service