Logo

SQL Server DRYQUARTS Function

Updated 2023-11-09 16:09:58.050000

Description

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

Syntax

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

column 1column 2
teaspoon0.004476
tablespoon0.013428
fluid dram0.003357
fluid ounce0.026855
cup0.214841
pint0.429682
quart0.859363
gallon3.437453
cubic inch0.014881
cubic foot25.71405
cubic yard694.2793
cubic mile3.79E+12
imperial ounce0.025801
imperial pint0.516028
imperial quart1.032056
imperial gallon4.128224
barrel (beer)106.561
barrel (oil)144.373
bushel32
gill0.107421
imperial gill0.129007
peck8
dry pint0.5
dry quart1
stere908.083
liter0.908083
cubic meter908.083

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

Here is the result set.

column 1
0.8593632