Share via


SysQuery::range Method [AX 2012]

Retrieves a string that represents a range filter that can be used as value for a QueryBuildRange object.

Syntax

client server public static str range(
    anytype _from, 
    anytype _to, 
   [boolean treatOnlyNullAsUnbound])

Run On

Called

Parameters

  • _from
    Type: anytype
    The lower bound of the range; nullNothingnullptrunita null reference (Nothing in Visual Basic) values are enabled.
  • _to
    Type: anytype
    The upper bound of the range; nullNothingnullptrunita null reference (Nothing in Visual Basic) values are enabled.
  • treatOnlyNullAsUnbound
    Type: boolean

    true if only nullNothingnullptrunita null reference (Nothing in Visual Basic) values are treated as unbound values; false if both empty and nullNothingnullptrunita null reference (Nothing in Visual Basic) values are be treated as unbound values; optional.

Return Value

Type: str
A string that represents a range filter that can be used as value for a QueryBuildRange object.

Remarks

This method generally returns the string in the format of '_from..._to'.

If the following conditions are true, the _from parameter represents an unbound value:

The _from parameter is null Nothing nullptr unit a null reference (Nothing in Visual Basic)

The _from parameter is an empty value, the treatOnlynullAsUnbound parameter is set to false, and the value is dropped from the string and becomes '_to'.

The same is true for the _to parameter. When both _from and _to are unbound values, the function returns an empty string and the range filter will be dropped from the query when it is used as a value for a QueryBuildRange object

For the treatOnlynullAsUnbound parameter, empty values are defined as values that are the equivalent of false. So an empty value for an integers is 0, an empty string for strings, the datenull method returning true for dates, and so on.

See Also

Reference

SysQuery Class