Logo

CONVERTAREA

Updated 2024-02-13 19:17:49.403000

Syntax

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

Description

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

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:

{"columns":[{"field":"acre","width":199},{"field":"acre, acres","width":439}],"rows":[{"acre":"square inches","acre, acres":"in^2, sq in, sq ins, square inch, square inches"},{"acre":"square feet","acre, acres":"ft^2, sq ft, square foot, square feet"},{"acre":"square yards","acre, acres":"yd^2, sq yd, sq yds, square yard, square yards"},{"acre":"square miles","acre, acres":"mi^2, sq mi, sq mis, square mile, square miles"},{"acre":"square meters","acre, acres":"m^2, sq m, sq ms, square meter, square meters, square metre, square metres"},{"acre":"square decimeters","acre, acres":"dm^2, sq dm, sq dms, square decimeter, square decimeters, square decimetre, square decimeters"},{"acre":"square centimeters","acre, acres":"cm^2, sq cm, sq cms, square centimeter, square centimeters, square centimetre, square centimeters"},{"acre":"square millimeters","acre, acres":"mm^2, sq mm, sq mms, square millimeter, square millimeters, square millimetre, square millimeters"},{"acre":"square microns","acre, acres":"µm^2, sq µm, sq µms, square micron, square micron"},{"acre":"square nanometers","acre, acres":"nm^2, sq nm, sq nms, square nanometer, square nanometers, square nanometre, square nanometers"},{"acre":"square picometers","acre, acres":"pm^2, sq pm, sq pms, square picometer, square picometers, square picometre, square picometres"},{"acre":"square femtometers","acre, acres":"fm^2, sq fm, sq fms, square femtometer, square femtometers, square femtometre, square femtometres"},{"acre":"square attometers","acre, acres":"am^2, sq am, sq ams, square attometer, square attometers, square attometre, square attometres"},{"acre":"square zeptometers","acre, acres":"zm^2, sq zm, sq zms, square zeptometer, square zeptometers, square zeptometre, square zeptometres"},{"acre":"square yoctometers","acre, acres":"ym^2, sq ym, sq yms, square yoctometer, square yoctometers, square yoctometre, square yoctometres"},{"acre":"square decameters","acre, acres":"dam^2, sq dam, sq dams, square decameter, square decameters, square decametre, square decameters"},{"acre":"square hectometers","acre, acres":", hm^2, sq hm, sq hms, square hectometer, square hectometers, square hectometre, square hectometres"},{"acre":"square kilometers","acre, acres":"km^2, sq km, sq kms, square kilometer, square kilometers, square kilometre, square kilometres"},{"acre":"hectares","acre, acres":"ha, hectare, hectares"}]}

Examples

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

Here is the result set.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"43560"}]}