Logo

SQL Server CONVERTAREA Function

Updated 2024-02-13 19:17:49.403000

Description

Use the scalar function CONVERTAREA to convert to and from acres, hectares, square feet, square inches, square meters, square miles, or square yards.

Syntax

SELECT [westclintech].[wct].[CONVERTAREA] (
  <@Area, float,>
 ,<@From_scale, nvarchar(4000),>
 ,<@To_scale, nvarchar(4000),>)

Arguments

@Area

is any real number. @Area 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 @Area is being converted from. @From_scale must be a valid value as specified in area unit representations. @From_scale must be of a data type that is implicitly convertible to varchar.

@To_scale

is the description of the units @Area is being converted to. @To_scale must be a valid value as specified in area unit representations. @To_scale must be of a data type that is implicitly convertible to varchar.

Return Type

float

Remarks

Area unit representations:

acreacre, acres
square inchesin^2, sq in, sq ins, square inch, square inches
square feetft^2, sq ft, square foot, square feet
square yardsyd^2, sq yd, sq yds, square yard, square yards
square milesmi^2, sq mi, sq mis, square mile, square miles
square metersm^2, sq m, sq ms, square meter, square meters, square metre, square metres
square decimetersdm^2, sq dm, sq dms, square decimeter, square decimeters, square decimetre, square decimeters
square centimeterscm^2, sq cm, sq cms, square centimeter, square centimeters, square centimetre, square centimeters
square millimetersmm^2, sq mm, sq mms, square millimeter, square millimeters, square millimetre, square millimeters
square micronsµm^2, sq µm, sq µms, square micron, square micron
square nanometersnm^2, sq nm, sq nms, square nanometer, square nanometers, square nanometre, square nanometers
square picometerspm^2, sq pm, sq pms, square picometer, square picometers, square picometre, square picometres
square femtometersfm^2, sq fm, sq fms, square femtometer, square femtometers, square femtometre, square femtometres
square attometersam^2, sq am, sq ams, square attometer, square attometers, square attometre, square attometres
square zeptometerszm^2, sq zm, sq zms, square zeptometer, square zeptometers, square zeptometre, square zeptometres
square yoctometersym^2, sq ym, sq yms, square yoctometer, square yoctometers, square yoctometre, square yoctometres
square decametersdam^2, sq dam, sq dams, square decameter, square decameters, square decametre, square decameters
square hectometers, hm^2, sq hm, sq hms, square hectometer, square hectometers, square hectometre, square hectometres
square kilometerskm^2, sq km, sq kms, square kilometer, square kilometers, square kilometre, square kilometres
hectaresha, hectare, hectares

Examples

select wct.CONVERTAREA(1, 'acre', 'ft^2');

Here is the result set.

column 1
43560