Logo

SQL Server IMPQUARTS Function

Updated 2023-11-09 16:24:20.587000

Description

Use the scalar function IMPQUARTS 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 quarts.

Syntax

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

column 1column 2
teaspoon0.004336843
tablespoon0.013010529
fluid dram0.003252632
fluid ounce0.026021058
cup0.20816846
pint0.41633692
quart0.83267384
gallon3.33069536
cubic inch0.014418595
cubic foot24.9153315
cubic yard672.713952
cubic mile3.66749E+12
imperial ounce0.025
imperial pint0.5
imperial quart1
imperial gallon4
barrel (beer)103.251556
barrel (oil)139.8892049
bushel31.0060359
gill0.10408423
imperial gill0.125
peck7.751508975
dry pint0.48446931094
dry quart0.96893862188
stere879.87663
liter0.87987663
cubic meter879.87663

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

Here is the result set.

column 1
0.83267384