Logo

SQL Server DRYPINTS Function

Updated 2023-11-09 16:08:23.807000

Description

Use the scalar function DRYPINTS 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 pints.

Syntax

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

column 1column 2
teaspoon0.0089517
tablespoon0.0268551
fluid dram0.006713775
fluid ounce0.0537102
cup0.4296816
pint0.8593632
quart1.7187264
gallon6.8749056
cubic inch0.029761628
cubic foot51.42809300
cubic yard1388.5585110
cubic mile7.5701100E+12
imperial ounce0.0516028
imperial pint1.032056
imperial quart2.064112
imperial gallon8.256448
barrel (beer)213.1220736
barrel (oil)288.7460352
bushel64
gill0.2148418
imperial gill0.2580142
peck16
dry pint1
dry quart2
stere1816.165957
liter1.816165957
cubic meter1816.165957

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

Here is the result set.

column 1
1.7187264