LEADING( ) function

Returns a string containing a specified number of leading digits.

Syntax

LEADING(number, leading_digits)

Parameters

number

Numeric. The value to return the leading digits from.

leading_digits

Numeric constant. Specifies the number of leading digits to be returned.

Output

Character.

Remarks

You can use this function to extract digits from a numeric field as a string, and filter out non-digit elements such as decimals or dollar signs from field values.

Examples

Example Return value

LEADING(Amount, 3)

“623”

If the field value is ($6,234.56) or -$6,234.56

LEADING(Amount, 5)

“62345”

If the field value is ($6,234.56) or -$6,234.56

LEADING(Amount, 3)

“000”

If the field value is $0.00

LEADING(Amount, 5)

“00000”

If the field value is $0.00

LEADING(Amount, 3)

“355”

If the field value is $3.55

LEADING(Amount, 5)

“35500”

If the field value is $3.55



(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback