Logo

SQL Server STERES Function

Updated 2023-11-09 16:29:12.307000

Description

Use the scalar function STERES 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 steres.

Syntax

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

column 1column 2
teaspoon4.9289E-06
tablespoon1.47868E-05
fluid dram3.69669E-06
fluid ounce2.95735E-05
cup0.000236588
pint0.000473177
quart0.000946353
gallon0.003785412
cubic inch1.63871E-05
cubic foot0.02831685
cubic yard0.7645549
cubic mile4168182000
imperial ounce2.84131E-05
imperial pint0.000568261
imperial quart0.001136523
imperial gallon0.00454609
barrel (beer)0.117347772
barrel (oil)0.158987304
bushel0.03523907
gill0.000118294
imperial gill0.000142065
peck0.008809768
dry pint0.000550611
dry quart0.001101221
stere1
liter0.001
cubic meter1

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

Here is the result set.

column 1
0.0009463529