Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to barrels


BARRELS
 
Updated: 01 December 2008 

Use BARRELS 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 barrels.
Syntax
SELECT [westclintech].[wct].[BARRELS] (
  <@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 barrels:
teaspoon
4.20027E-05
tablespoon
0.000126008
fluid dram
3.1502E-05
fluid ounce
0.000252016
cup
0.002016129
pint
0.004032258
quart
0.008064516
gallon
0.032258065
cubic inch
0.000139645
cubic foot
0.24130708
cubic yard
6.51529116
cubic mile
35519908000
imperial ounce
0.000242127
imperial pint
0.004842542
imperial quart
0.009685084
imperial gallon
0.038740336
barrel (beer)
1
barrel (oil)
1.35483871
bushel
0.300296064
gill
0.001008065
imperial gill
0.001210636
peck
0.075074016
dry pint
0.004692126
dry quart
0.009384252
stere
8.52167911
liter
0.008521679
cubic meter
8.52167911
 
·         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.BARRELS(1, 'quart')
Here is the result set
----------------------
0.00806451612903226
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service