Logo

SQL Server BUSHELS Function

Updated 2023-11-09 15:42:55.410000

Description

Use BUSHELS 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 bushels.

Syntax

SELECT [westclintech].[wct].[BUSHELS] (
  <@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 Type

float

Remarks

The following table is a representation of the conversion of one of the volume units of measure into bushels:

column 1column 2
teaspoon0.000139871
tablespoon0.000419613
fluid dram0.000104903
fluid ounce0.000839226
cup0.006713804
pint0.013427609
quart0.026855218
gallon0.10742087
cubic inch0.000465025
cubic foot0.803563913
cubic yard21.6962257
cubic mile1.18283E+11
imperial ounce0.000806295
imperial pint0.016125892
imperial quart0.032251785
imperial gallon0.12900714
barrel (beer)3.33004698
barrel (oil)4.511676554
bushel1
gill0.003356902
imperial gill0.004031473
peck0.25
dry pint0.015625
dry quart0.03125
stere28.3775918
liter0.028377592
cubic meter28.3775918

Conversion of metric values (liters and cubic meters) includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.

Examples

select wct.BUSHELS(1, 'quart');

Here is the result set

----------------------
          0.0268552176