Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to imperial ounces


IMPOUNCES
 
Updated: 01 December 2008 

Use IMPOUNCES to convert from barrels (US beer barrels), bbl (oil barrel), bushels, cubic feet, cubic inches, cubic meters, cubic miles, cubic yards, cups, dry pints, dry quarts, fluid drams, fluid ounces, gallons, gills, imperial gallons, imperial gills, imperial pints, imperial quarts, liters, pecks, pints, quarts, steres, tablespoons, or teaspoons to imperial ounces.
Syntax
SELECT [westclintech].[wct].[IMPOUNCES] (
  <@Volume, float,>
 ,<@From_scale, nvarchar(4000),>)
Arguments
@Volume
is any real number. @Volume 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 @Volume. @From_scale must be a valid value as specified in volume 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 volume units of measure into imperial ounces:
teaspoon
0.173473717
tablespoon
0.52042115
fluid dram
0.130105288
fluid ounce
1.0408423
cup
8.3267384
pint
16.6534768
quart
33.3069536
gallon
133.227814
cubic inch
0.576743786
cubic foot
996.613262
cubic yard
26908.5581
cubic mile
1.46699E+14
imperial ounce
1
imperial pint
20
imperial quart
40
imperial gallon
160
barrel (beer)
4130.06225
barrel (oil)
5595.56821
bushel
1240.24144
gill
4.1633692
imperial gill
5
peck
310.060359
dry pint
19.37877244
dry quart
38.75754488
stere
35195.0652
liter
35.1950652
cubic meter
35195.0652
 
·         Conversion of metric values (liters and cubic meters) includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.
Example
 
select wct.IMPOUNCES(1, 'quart')
Here is the result set
----------------------
33.3069536
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service