Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume units of measure


CONVERTVOLUME
 
Updated: 01 December 2008 

Use CONVERTVOLUME to convert to and 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.
Syntax
SELECT [westclintech].[wct].[CONVERTVOLUME] (
  <@Volume, float,>
 ,<@From_scale, nvarchar(4000),>
 ,<@To_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 @Volume is being converted from. @From_scale must be a valid value as specified in area unit representations. @From_scale must be of a data type that is implicitly convertible to varchar.
 
@To_scale
is the description of the units @Volume is being converted to. @To_scale must be a valid value as specified in area unit representations. @To_scale must be of a data type that is implicitly convertible to varchar.
 
Return Types
float
Remarks
 
teaspoons
tsp, tsps, teaspoon, teaspoons
tablespoons
tbsp, tbsps, tablespoon, tablespoons
fluid drams
fl dr, fldr, fluid dram, fluid drams
fluid ounces
fl oz, floz, fl ozs, flozs, fluid ounce, fluid ounces
cups
cup, cups
pints
pint, pints
quarts
qt, qts, quart, quarts
gallons
gal, gals, gallon, gallons
cubic inches
 in^3, cu in, cu ins, cubic inch, cubic inches
cubic feet
 ft^3, cu ft, cubic foot, cubic feet
cubic yards
 yd^3, cu yd, cu yds, cubic yard, cubic yards
cubic miles
 mi^3, cu mi, cu mis, cubic mile, cubic miles
imperial ounces
 imp oz, impoz, imp ozs, impozs, imperial ounce, imperial ounces
imperial pints
 imp pt, imppt, imp pts, imppts, imperial pint, imperial pints
imperial quarts
 imp qt, impqt, imp qts, impqts, imperial quart, imperial quarts
imperial gallons
 imp gal, impgal, imp gals, impgals, imperial gallon, imperial gallons
barrels (US beer barrels)
 barrel, barrels
barrels (oil barrels)
 bbl, bbls
bushels
 bu, bus, bushel, bushels
gills
 gi, gill, gills
imperial gills
 imp gi, imperial gill, imperial gills
pecks
 pk, peck, pecks
dry pints
 dry pt, dry pint, dry pints
dry quarts
 dry qt, dry quart, dry quarts
steres
 st, stere, steres
liters
 l, liter, liters
deciliters
dl, deciliter, deciliters
centiliters
cl, centiliter, centiliters
milliliters
ml, milliliter, milliliters
microliters
µl, microliter, microliters
nanoliters
nl, nanoliter, nanoliters
picoliters
pl, picoliter, picoliters
femtoliters
fl, femtoliter, femtoliters
attoliters
al, attoliter, attoliters
zeptoliters
zl, zeptoliter, zeptoliters
yoctoliters
yl, yoctoliter, yoctoliters
decaliters
dal, decaliter, decaliters
hectoliters
hl, hectoliter, hectoliters
kiloliters
kl, kiloliter, kiloliters 'liters
cubic meters
m^3, cu m, cu ms, cubic meter, cubic meters, cubic metre, cubic metres
cubic decimeter
dm^3, cu dm, cu dms, cubic decimeter, cubic decimeters, cubic decimetre, cubic decimetres
cubic centimeter
cm^3, cu cm, cu cms, cubic centimeter, cubic centimeters, cubic centimetre, cubic centimetres
cubic millimeter
mm^3, cu mm, cu mms, cubic millimeter, cubic millimeters, cubic millimetre, cubic millimetres
cubic microns
µm^3, cu µm, cu µms, cubic micron, cubic microns
cubic nanometers
nm^3, cu nm, cu nms, cubic nanometer, cubic nanometers, cubic nanometre, cubic nanometres
cubic picometers
pm^3, cu pm, cu pms, cubic picometer, cubic picometers, cubic picometre, cubic picometres
cubic femtometers
fm^3, cu fm, cu fms, cubic femtometer, cubic femtometers, cubic femtometre, cubic femtometres
cubic attometers
am^3, cu am, cu ams, cubic attometer, cubic attometers, cubic attometre, cubic attometres
cubic zeptometers
zm^3, cu zm, cu zms, cubic zeptometer, cubic zeptometers, cubic zeptometre, cubic zeptometres
cubic yoctometers
ym^3, cu ym, cu yms, cubic yoctometer, cubic yoctometers, cubic yoctometre, cubic yoctometres
cubic decameters
dam^3, cu dam, cu dams, cubic decameter, cubic decameters, cubic decametre, cubic decametres
cubic hectometers
hm^3, cu hm, cu hms, cubic hectometer, cubic hectometers, cubic hectometre, cubic hectometres
cubic kilometers
km^3, cu km, cu kms, cubic kilometer, cubic kilometers, cubic kilometre, cubic kilometres 'metric
 
Example
 
select wct.CONVERTVOLUME(100, 'l', 'gals')
Here is the result set
----------------------
26.4172052
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service