Logo

IMPPINTS

Updated 2023-11-09 16:23:36.783000

Syntax

SELECT [westclintech].[wct].[IMPPINTS] (
  <@Volume, float,>
 ,<@From_scale, nvarchar(4000),>)

Description

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

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 pints:

{"columns":[{"field":"column 1"},{"field":"column 2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"teaspoon","column 2":"0.008673686"},{"column 1":"tablespoon","column 2":"0.026021058"},{"column 1":"fluid dram","column 2":"0.006505264"},{"column 1":"fluid ounce","column 2":"0.05204211"},{"column 1":"cup","column 2":"0.41633692"},{"column 1":"pint","column 2":"0.83267384"},{"column 1":"quart","column 2":"1.66534768"},{"column 1":"gallon","column 2":"6.66139072"},{"column 1":"cubic inch","column 2":"0.028837189"},{"column 1":"cubic foot","column 2":"49.8306631"},{"column 1":"cubic yard","column 2":"1345.4279"},{"column 1":"cubic mile","column 2":"7.33497E+12"},{"column 1":"imperial ounce","column 2":"0.05"},{"column 1":"imperial pint","column 2":"1"},{"column 1":"imperial quart","column 2":"2"},{"column 1":"imperial gallon","column 2":"8"},{"column 1":"barrel (beer)","column 2":"206.5031123"},{"column 1":"barrel (oil)","column 2":"279.7784102"},{"column 1":"bushel","column 2":"62.0120718"},{"column 1":"gill","column 2":"0.20816844"},{"column 1":"imperial gill","column 2":"0.25"},{"column 1":"peck","column 2":"15.5030179"},{"column 1":"dry pint","column 2":"0.96893861875"},{"column 1":"dry quart","column 2":"1.93787723750"},{"column 1":"stere","column 2":"1759.75326"},{"column 1":"liter","column 2":"1.75975326"},{"column 1":"cubic meter","column 2":"1759.75326"}]}

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

Here is the result set.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1.66534768"}]}