Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to fluid ounces


FLOUNCES
 
Updated: 01 December 2008 

Use FLOUNCES 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 ounces.
Syntax
SELECT [westclintech].[wct].[FLOUNCES] (
  <@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 Types
float
Remarks
·         The following table is a representation of the conversion of one of the volume units of measure into fluid ounces:
teaspoon
0.166666667
tablespoon
0.5
fluid dram
0.125
fluid ounce
1
cup
8
pint
16
quart
32
gallon
128
cubic inch
0.554112554
cubic foot
957.506494
cubic yard
25852.6753
cubic mile
1.40943E+14
imperial ounce
0.960760338
imperial pint
19.2152068
imperial quart
38.4304135
imperial gallon
153.721654
barrel (beer)
3968
barrel (oil)
5376
bushel
1191.57478
gill
4
imperial gill
4.80380169
peck
297.893695
dry pint
18.61835502
dry quart
37.23671005
stere
33814.0227
liter
33.8140227
cubic meter
33814.0227
 
·         Conversion of metric values (liters and cubic meters) includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.
Example
 
select wct.FLOUNCES(1, 'quart')
Here is the result set
----------------------
32
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service