Logo

SQL Server KMHR Function

Updated 2023-06-15 21:43:22.863000

Description

Use the scalar function KMHR to convert from feet per hour, feet per minute, feet per second, inches per second, kilometers per hour, knots, miles per hour, miles per minute, miles per second, meters per second, meters per minute, or meters per hour to kilometers per hour.

Syntax

SELECT [westclintech].[wct].[KMHR] (
  <@Speed, float,>
 ,<@From_scale, nvarchar(4000),>)

Arguments

@Speed

is any real number. @Speed 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 @Speed. @From_scale must be a valid value as specified in speed 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 speed units of measure into kilometers per hour:

column 1column 2
feet per hour0.000305
feet per minute0.018288
feet per second1.09728
inches per second0.09144
kilometers per hour1
knots1.852
miles per hour1.609344
miles per minute96.56064
miles per second5793.638
meters per second3.6
meters per minute0.06
meters per hour0.001

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

Examples

select wct.KMHR(10, 'm/s');

Here is the result set.

column 1
36