Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to cups


CUPS
 
Updated: 01 December 2008 

Use wct.CUPS 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 cups.
Syntax
SELECT [westclintech].[wct].[CUPS] (
  <@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 cups:
teaspoon
0.020833333
tablespoon
0.0625
fluid dram
0.015625
fluid ounce
0.125
cup
1
pint
2
quart
4
gallon
16
cubic inch
0.069264069
cubic foot
119.688312
cubic yard
3231.58442
cubic mile
1.76179E+13
imperial ounce
0.120095042
imperial pint
2.40190084
imperial quart
4.80380169
imperial gallon
19.2152068
barrel (beer)
496
barrel (oil)
672
bushel
148.946848
gill
0.5
imperial gill
0.600475211
peck
37.2367119
dry pint
2.327294377
dry quart
4.654588756
stere
4226.75284
liter
4.22675284
cubic meter
4226.75284
 
·         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.CUPS(1, 'quart')
Here is the result set
----------------------
4
 
(1 row(s) affected)


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service