Logo

SQL Server CUINCHES Function

Updated 2023-11-09 16:03:22.817000

Description

Use the scalar function CUINCHES 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 cubic inches.

Syntax

SELECT [westclintech].[wct].[CUINCHES] (
  <@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 cubic inches:

column 1column 2
teaspoon0.30078125
tablespoon0.90234375
fluid dram0.225585938
fluid ounce1.8046875
cup14.4375
pint28.875
quart57.75
gallon231
cubic inch1
cubic foot1728
cubic yard46656
cubic mile2.54358E+14
imperial ounce1.73387217
imperial pint34.6774434
imperial quart69.3548869
imperial gallon277.419547
barrel (beer)7161
barrel (oil)9702
bushel2150.42011
gill7.21875
imperial gill8.66936086
peck537.605028
dry pint33.60031257
dry quart67.20062517
stere61023.7441
liter61.0237441
cubic meter61023.7441

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

Here is the result set.

column 1
57.75