Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to cubic yards


CUYARDS
 
Updated: 01 December 2008 

Use CUYARDS 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 cubic yards.
Syntax
SELECT [westclintech].[wct].[CUYARDS] (
  <@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 cubic yards:
teaspoon
6.44679E-06
tablespoon
1.93404E-05
fluid dram
4.83509E-06
fluid ounce
3.86807E-05
cup
0.000309446
pint
0.000618891
quart
0.001237783
gallon
0.004951132
cubic inch
2.14335E-05
cubic foot
0.037037037
cubic yard
1
cubic mile
5451776000
imperial ounce
3.71629E-05
imperial pint
0.000743258
imperial quart
0.001486516
imperial gallon
0.005946064
barrel (beer)
0.153485082
barrel (oil)
0.207947531
bushel
0.046090966
gill
0.000154723
imperial gill
0.000185814
peck
0.011522742
dry pint
0.000720171
dry quart
0.001440343
stere
1.30795062
liter
0.001307951
cubic meter
1.30795062
 
·         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.CUYARDS(1, 'quart')
Here is the result set
----------------------
0.00123778292
 
(1 row(s) affected)


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service