Logo

SQL Server CUFEET Function

Updated 2023-11-09 16:02:32.253000

Description

Use the scalar function CUFEET 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 feet.

Syntax

SELECT [westclintech].[wct].[CUFEET] (
  <@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 feet:

column 1column 2
teaspoon0.000174063
tablespoon0.000522190
fluid dram0.000130547
fluid ounce0.001044379
cup0.008355035
pint0.016710069
quart0.033420139
gallon0.133680556
cubic inch0.000578704
cubic foot1
cubic yard27
cubic mile1.47198E+11
imperial ounce0.001003398
imperial pint0.020067965
imperial quart0.04013593
imperial gallon0.16054372
barrel (beer)4.144097222
barrel (oil)5.614583333
bushel1.24445608
gill0.004177517
imperial gill0.005016991
peck0.311114021
dry pint0.019444625
dry quart0.038889251
stere35.3146667
liter0.035314667
cubic meter35.3146667

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.CUFEET(1, 'quart');

Here is the result set.

column 1
0.0334201389