Logo

SQL Server CONVERTSPEED Function

Updated 2024-02-13 19:18:31.783000

Description

Use the scalar function CONVERTSPEED to convert to and 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.

Syntax

SELECT [westclintech].[wct].[CONVERTSPEED] (
  <@Speed, float,>
 ,<@From_scale, nvarchar(4000),>
 ,<@To_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 @Speed is being converted from. @From_scale must be a valid value as specified in area unit representations. @From_scale must be of a data type that is implicitly convertible to varchar.

@To_scale

is the description of the units @Speed is being converted to. @To_scale must be a valid value as specified in area unit representations. @To_scale must be of a data type that is implicitly convertible to varchar.

Return Type

float

Remarks

· Speed unit representations:

feet per hourft/h, feet per hour, foot per hour, fph, ft·h
feet per minuteft/min, feet per minute, foot per minute, fpm, ft·m
feet per secondft/s, feet per second, foot per second, fps, ft·s
inches per secondin/s, inches per second, inch per second, ips, in·s
kilometers per hourkm/h, kilometers per hour, kilometer per hour, kph, km·h
knotsknot, knots
miles per hourmi/h, miles per hour, mile per hour, mph, mi·h
miles per minutemi/min, miles per minute, mile per minute, mpm, mi·m
miles per secondmi/s, miles per second, mile per second, mi·s
meters per secondm/s, meters per second, meter per second, mps, m·s
decimeters per seconddm/s, decimeters per second, decimeter per second, dmps, dm·s
centimeters per secondcm/s, centimeters per second, centimeter per second, cmps, cm·s
millimeters per secondmm/s, millimeters per second, millimeter per second, mmps, mm·s
microns per secondµm/s, microns per second, micron per second, µmps, µm·s
nanometers per secondnm/s, nanometers per second, nanometer per second, nmps, nm·s
picometers per secondpm/s, picometers per second, picometer per second, pmps, pm·s
femtometers per secondfm/s, femtometers per second, femtometer per second, fmps, fm·s
attometers per secondam/s, attometers per second, attometer per second, amps, am·s
zeptometers per secondzm/s, zeptometers per second, zeptometer per second, zmps, zm·s
yoctometers per secondym/s, yoctometers per second, yoctometer per second, ymps, ym·s
decameters per seconddam/s, decameters per second, decameter per second, damps, dam·s
hectometers per secondhm/s, hectometers per second, hectometer per second, hmps, hm·s
kilometers per secondkm/s, kilometers per second, kilometer per second, kmps, km·s
meters per minutem/min, meters per minute, meter per minute, m·min
decimeters per minutedm/min, decimeters per minute, decimeter per minute, dmpm, dm·min
centimeters per minutecm/min, centimeters per minute, centimeter per minute, cmpm, cm·min
millimeters per minutemm/min, millimeters per minute, millimeter per minute, mmpm, mm·min
microns per minuteµm/min, microns per minute, micron per minute, µmpm, µm·min
nanometers per minutenm/min, nanometers per minute, nanometer per minute, nmpm, nm·min
picometers per minutepm/min, picometers per minute, picometer per minute, pmpm, pm·min
femtometers per minutefm/min, femtometers per minute, femtometer per minute, fmpm, fm·min
attometers per minuteam/min, attometers per minute, attometer per minute, ampm, am·min
zeptometers per minutezm/min, zeptometers per minute, zeptometer per minute, zmpm, zm·min
yoctometers per minuteym/min, yoctometers per minute, yoctometer per minute, ympm, ym·min
decameters per minutedam/min, decameters per minute, decameter per minute, dampm, dam·min
hectometers per minutehm/min, hectometers per minute, hectometer per minute, hmpm, hm·min
kilometers per minutekm/min, kilometers per minute, kilometer per minute, kmpm, km·min
meters per hourm/h, meters per hour, meter per hour, m·h
decimeters per hourdm/h, decimeters per hour, decimeter per hour, dmph, dm·h
centimeters per hourcm/h, centimeters per hour, centimeter per hour, cmph, cm·h
millimeters per hourmm/h, millimeters per hour, millimeter per hour, mmph, mm·h
microns per hourµm/h, microns per hour, micron per hour, µmph, µm·h
nanometers per hournm/h, nanometers per hour, nanometer per hour, nmph, nm·h
picometers per hourpm/h, picometers per hour, picometer per hour, pmph, pm·h
femtometers per hourfm/h, femtometers per hour, femtometer per hour, fmph, fm·h
attometers per houram/h, attometers per hour, attometer per hour, amph, am·h
zeptometers per hourzm/h, zeptometers per hour, zeptometer per hour, zmph, zm·h
yoctometers per hourym/h, yoctometers per hour, yoctometer per hour, ymph, ym·h
decameters per hourdam/h, decameters per hour, decameter per hour, damph, dam·h
hectometers per hourhm/h, hectometers per hour, hectometer per hour, hmph, hm·h 'metric per hour

Examples

select wct.CONVERTSPEED(3 * power(10, 8), 'm/s', 'mi/s');

Here is the result set.

column 1
186411.3576