Logo

SQL Server IMPOUNCES Function

Updated 2023-11-09 16:22:39.347000

Description

Use the scalar function IMPOUNCES 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 imperial ounces.

Syntax

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

column 1column 2
teaspoon0.173473717
tablespoon0.52042115
fluid dram0.130105288
fluid ounce1.0408423
cup8.3267384
pint16.6534768
quart33.3069536
gallon133.227814
cubic inch0.576743786
cubic foot996.613262
cubic yard26908.5581
cubic mile1.46699E+14
imperial ounce1
imperial pint20
imperial quart40
imperial gallon160
barrel (beer)4130.06225
barrel (oil)5595.56821
bushel1240.24144
gill4.1633692
imperial gill5
peck310.060359
dry pint19.37877244
dry quart38.75754488
stere35195.0652
liter35.1950652
cubic meter35195.0652

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

Here is the result set.

column 1
33.3069536