Logo

SQL Server TONNES Function

Updated 2023-11-09 19:13:46.287000

Description

Use the scalar function TONNES to convert from drams, grains, grams, hundredweights, ounces, pennyweights, pounds, stones, tonnes, tons, troy pounds or troy ounces to tonnes.

Syntax

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

Arguments

@From_scale

is the description of the units for @Weight. @From_scale must be a valid value as specified in weight 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 weight units of measure into tonnes:

column 1column 2
grains0.00000006480000
drams0.00000177184520
ounces avoirdupois0.00002834952000
pounds avoirdupois0.00045359237000
stones0.006350293
hundredweights0.04535923700000
tons0.90718474000000
pennyweights0.00000155517384
ounces troy0.00003110347680
pounds troy0.00037324172160
grams0.00000100000000
tonnes1.00000000000000

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

Examples

select wct.TONNES(100, 'lbs');

Here is the result set.

----------------------
0.045359237