Logo

GESTEP

Updated 2023-11-08 20:44:36.803000

Syntax

SELECT [westclintech].[wct].[GESTEP] (
  <@Number, float,>
 ,<@Step_value, float,>)

Description

Use the scalar function GESTEP to test whether a number is greater than or equal to a threshold value.

Arguments

@Step_value

is the threshold value. @Step_value is an expression of type float or of a type that can be implicitly converted to float.

@Number

is the value to test against the step. @Number is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

If @Number = @Step_value then GESTEP returns a one (1), otherwise GESTEP returns a zero (0).

If @Step_value is null, GESTEP assumes zero (0).

Examples

select wct.GESTEP(5, 4);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1"}]}
select wct.GESTEP(5, 5);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1"}]}
select wct.GESTEP(-4, -5);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1"}]}
select wct.GESTEP(-1, 0);

This produces the following result.

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