CONVERTTEMP
Updated: 01 December 2008
Use CONVERTTEMP to convert to and from Celsius, Fahrenheit, Kelvin, or Rankine.
Syntax
SELECT [westclintech].[wct].[CONVERTTEMP] (
<@Temperature, float,>
,<@From_scale, nvarchar(4000),>
,<@To_scale, nvarchar(4000),>)
Arguments
@Temperature
is any real number. @Temperature 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 @Temperature 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 @Temperature 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 Types
float
Remarks
Celsius
|
C
|
Kelvin
|
K
|
Fahrenheit
|
F
|
Rankine
|
R
|
Example
select wct.CONVERTTEMP(100, 'C', 'F')
Here is the result set
----------------------
212
(1 row(s) affected)