Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to pecks


PECKS
 
Updated: 01 December 2008 

Use PECKS 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 pecks.
Syntax
SELECT [westclintech].[wct].[PECKS] (
  <@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 pecks:
teaspoon
0.000559484
tablespoon
0.001678451
fluid dram
0.000419613
fluid ounce
0.003356902
cup
0.026855218
pint
0.053710435
quart
0.10742087
gallon
0.429683481
cubic inch
0.001860102
cubic foot
3.21425565
cubic yard
86.7849026
cubic mile
4.73132E+11
imperial ounce
0.003225178
imperial pint
0.06450357
imperial quart
0.12900714
imperial gallon
0.516028558
barrel (beer)
13.3201879
barrel (oil)
18.04670619
bushel
4
gill
0.013427615
imperial gill
0.016125892
peck
1
dry pint
0.0625
dry quart
0.125
stere
113.510367
liter
0.113510367
cubic meter
113.510367
 
·         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.PECKS(1, 'quart')
Here is the result set
----------------------
0.10742087
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service