Logo

SQL Server FLOUNCES Function

Updated 2023-11-09 16:13:22.750000

Description

Use the scalar function FLOUNCES 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 fluid ounces.

Syntax

SELECT [westclintech].[wct].[FLOUNCES] (
  <@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 fluid ounces:

column 1column 2
teaspoon0.166666667
tablespoon0.5
fluid dram0.125
fluid ounce1
cup8
pint16
quart32
gallon128
cubic inch0.554112554
cubic foot957.506494
cubic yard25852.6753
cubic mile1.40943E+14
imperial ounce0.960760338
imperial pint19.2152068
imperial quart38.4304135
imperial gallon153.721654
barrel (beer)3968
barrel (oil)5376
bushel1191.57478
gill4
imperial gill4.80380169
peck297.893695
dry pint18.61835502
dry quart37.23671005
stere33814.0227
liter33.8140227
cubic meter33814.0227

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

Here is the result set.

column 1
32