Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to dry pints


DRYPINTS
 
Updated: 01 December 2008 

Use DRYPINTS 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 dry pints.
Syntax
SELECT [westclintech].[wct].[DRYPINTS] (
  <@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 dry pints:
teaspoon
0.0089517
tablespoon
0.0268551
fluid dram
0.006713775
fluid ounce
0.0537102
cup
0.4296816
pint
0.8593632
quart
1.7187264
gallon
6.8749056
cubic inch
0.029761628
cubic foot
51.42809300
cubic yard
1388.5585110
cubic mile
7.5701100E+12
imperial ounce
0.0516028
imperial pint
1.032056
imperial quart
2.064112
imperial gallon
8.256448
barrel (beer)
213.1220736
barrel (oil)
288.7460352
bushel
64
gill
0.2148418
imperial gill
0.2580142
peck
16
dry pint
1
dry quart
2
stere
1816.165957
liter
1.816165957
cubic meter
1816.165957
 
·         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.DRYPINTS(1, 'quart')
Here is the result set
----------------------
1.7187264
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service