Logo

SQL Server NMILES Function

Updated 2023-11-09 14:18:02.773000

Description

Use the scalar function NMILES to convert from fathoms, feet, furlongs, inches, meters, miles, nautical miles, pica, points or yards to nautical miles.

Syntax

SELECT [westclintech].[wct].[NMILES] (
  <@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 Type

float

Remarks

The following table is a representation of the conversion of one of the length units of measure into nautical miles:

column 1column 2
inches0.0000137149028
feet0.0001645788340
yards0.0004937365010
meters0.0005399568030
fathoms0.0009874730020
furlongs0.1086220300000
miles0.8689762420000
nautical miles1.0000000000000
pica0.0000022858171
points0.0000002

Conversion of meters includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.

Examples

select wct.NMILES(100, 'yd');

Here is the result set.

column 1
0.0493736500719475