Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert weight to ounces


OUNCES
 
Updated: 01 December 2008 

Use OUNCES to convert from drams, grains, grams, hundredweights, ounces, pennyweights, pounds, stones, tonnes, tons, troy pounds, or troy ounces to ounces.
Syntax
SELECT [westclintech].[wct].[OUNCES] (
  <@Weight, float,>
 ,<@From_scale, nvarchar(4000),>)
Arguments
@Weight
is any real number. @Weight 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 @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 Types
float
Remarks
·         The following table is a representation of the conversion of one of the weight units of measure into ounces:
grains
0.002285714290
drams
0.0625
ounces avoirdupois
1
pounds avoirdupois
16
stones
224
hundredweights
1600
tons
32000
pennyweights
0.0548571429
ounces troy
1.09714286
pounds troy
13.1657143
grams
0.03527396919
tonnes
35273.9619
 
·         Conversion of grams includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.
Example
 
select wct.OUNCES(100, 'lbs')
Here is the result set
----------------------
1600
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service