Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to cubic miles


CUMILES
 
Updated: 01 December 2008 

Use CUMILES 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 cubic miles.
Syntax
SELECT [westclintech].[wct].[CUMILES] (
  <@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 cubic miles:
teaspoon
1.18251E-15
tablespoon
3.54753E-15
fluid dram
8.86883E-16
fluid ounce
7.09507E-15
cup
5.67605E-14
pint
1.13521E-13
quart
2.27042E-13
gallon
9.08169E-13
cubic inch
3.93147E-15
cubic foot
6.79357E-12
cubic yard
1.83426E-10
cubic mile
1
imperial ounce
6.81666E-15
imperial pint
1.36333E-13
imperial quart
2.72666E-13
imperial gallon
1.09067E-12
barrel (beer)
2.81532E-11
barrel (oil)
3.81431E-11
bushel
8.4543E-12
gill
2.83803E-14
imperial gill
3.40833E-14
peck
2.11358E-12
dry pint
1.32098E-13
dry quart
2.64197E-13
stere
2.39913E-10
liter
2.39913E-13
cubic meter
2.39913E-10
 
·         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.CUMILES(1, 'quart')
Here is the result set
----------------------
2.27042146E-13
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service