Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to pints


PINTS
 
Updated: 01 December 2008 

Use PINTS 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 pints.
Syntax
SELECT [westclintech].[wct].[PINTS] (
  <@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 pints:
teaspoon
0.010416667
tablespoon
0.03125
fluid dram
0.0078125
fluid ounce
0.0625
cup
0.5
pint
1
quart
2
gallon
8
cubic inch
0.034632035
cubic foot
59.8441558
cubic yard
1615.79221
cubic mile
8.80894E+12
imperial ounce
0.060047521
imperial pint
1.20095042
imperial quart
2.40190084
imperial gallon
9.60760338
barrel (beer)
248
barrel (oil)
336
bushel
74.4734238
gill
0.25
imperial gill
0.300237605
peck
18.6183559
dry pint
1.163647189
dry quart
2.327294378
stere
2113.37642
liter
2.11337642
cubic meter
2113.37642
 
·         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.PINTS(1, 'quart')
Here is the result set
----------------------
2
 
(1 row(s) affected)


Copyright 2008-2013 WestClinTech LLC         Privacy Policy        Terms of Service