Logo

SQL Server CUMILES Function

Updated 2023-11-09 16:05:37.893000

Description

Use the scalar function 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 Type

float

Remarks

The following table is a representation of the conversion of one of the volume units of measure into cubic miles:

column 1column 2
teaspoon1.18251E-15
tablespoon3.54753E-15
fluid dram8.86883E-16
fluid ounce7.09507E-15
cup5.67605E-14
pint1.13521E-13
quart2.27042E-13
gallon9.08169E-13
cubic inch3.93147E-15
cubic foot6.79357E-12
cubic yard1.83426E-10
cubic mile1
imperial ounce6.81666E-15
imperial pint1.36333E-13
imperial quart2.72666E-13
imperial gallon1.09067E-12
barrel (beer)2.81532E-11
barrel (oil)3.81431E-11
bushel8.4543E-12
gill2.83803E-14
imperial gill3.40833E-14
peck2.11358E-12
dry pint1.32098E-13
dry quart2.64197E-13
stere2.39913E-10
liter2.39913E-13
cubic meter2.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.

Examples

select wct.CUMILES(1, 'quart');

Here is the result set.

column 1
2.27042146E-13