Logo

SQL Server IMPGILLS Function

Updated 2023-11-09 16:21:40.043000

Description

Use the scalar function IMPGILLS 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 gills.

Syntax

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

column 1column 2
teaspoon0.034694743
tablespoon0.10408423
fluid dram0.026021058
fluid ounce0.20816846
cup1.66534768
pint3.33069536
quart6.66139072
gallon26.64556288
cubic inch0.115348757
cubic foot199.322652
cubic yard5381.71161
cubic mile2.93399E+13
imperial ounce0.2
imperial pint4
imperial quart8
imperial gallon32
barrel (beer)826.01245
barrel (oil)1119.113642
bushel248.048287
gill0.832674202
imperial gill1
peck62.0120718
dry pint3.8757559
dry quart7.7515118
stere7039.01304
liter7.03901304
cubic meter7039.01304

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

Here is the result set.

column 1
6.66139072