Logo

SQL Server FLDRAMS Function

Updated 2023-11-09 16:11:04.647000

Description

Use the scalar function FLDRAMS 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 fluid drams.

Syntax

SELECT [westclintech].[wct].[FLDRAMS] (
  <@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 fluid drams:

column 1column 2
teaspoon1.333333333
tablespoon4
fluid dram1
fluid ounce8
cup64
pint128
quart256
gallon1024
cubic inch4.43290044
cubic foot7660.05196
cubic yard206821.4024
cubic mile1.12754E+15
imperial ounce7.68608272
imperial pint153.721654
imperial quart307.443308
imperial gallon1229.773232
barrel (beer)31744
barrel (oil)43008
bushel9532.59824
gill32
imperial gill38.43041352
peck2383.14956
dry pint148.9468401
dry quart297.8936804
stere270512.1816
liter270.5121816
cubic meter270512.1816

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

Here is the result set.

column 1
256