Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to imperial pints


IMPPINTS
 
Updated: 01 December 2008 

Use IMPPINTS 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 imperial pints.
Syntax
SELECT [westclintech].[wct].[IMPPINTS] (
  <@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 imperial pints:
teaspoon
0.008673686
tablespoon
0.026021058
fluid dram
0.006505264
fluid ounce
0.05204211
cup
0.41633692
pint
0.83267384
quart
1.66534768
gallon
6.66139072
cubic inch
0.028837189
cubic foot
49.8306631
cubic yard
1345.4279
cubic mile
7.33497E+12
imperial ounce
0.05
imperial pint
1
imperial quart
2
imperial gallon
8
barrel (beer)
206.5031123
barrel (oil)
279.7784102
bushel
62.0120718
gill
0.20816844
imperial gill
0.25
peck
15.5030179
dry pint
0.96893861875
dry quart
1.93787723750
stere
1759.75326
liter
1.75975326
cubic meter
1759.75326
 
·         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.IMPPINTS(1, 'quart')
Here is the result set
----------------------
1.66534768
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service