Logo

SQL Server IMPPINTS Function

Updated 2023-11-09 16:23:36.783000

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.

Syntax

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

column 1column 2
teaspoon0.008673686
tablespoon0.026021058
fluid dram0.006505264
fluid ounce0.05204211
cup0.41633692
pint0.83267384
quart1.66534768
gallon6.66139072
cubic inch0.028837189
cubic foot49.8306631
cubic yard1345.4279
cubic mile7.33497E+12
imperial ounce0.05
imperial pint1
imperial quart2
imperial gallon8
barrel (beer)206.5031123
barrel (oil)279.7784102
bushel62.0120718
gill0.20816844
imperial gill0.25
peck15.5030179
dry pint0.96893861875
dry quart1.93787723750
stere1759.75326
liter1.75975326
cubic meter1759.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.

column 1
1.66534768