OQL RANGEEND

Last modified: August 27, 2024

Description

The RANGEEND function extracts the end value of a range parameter.

RANGEBEGIN and RANGEEND are OQL functions that use a parameter, and OQL parameters are only available in datasets (which are used for generating a report). When you create a page and add a report that has a dataset, you can use RANGEBEGIN and RANGEEND in that dataset.

Syntax

The syntax is as follows:

RANGEEND ( $range )

$range specifies the range parameter.

Example

This is an example of using a range in OQL, where $range is set to last week, which will give you all the customers born in the last week:

SELECT FirstName AS First, LastName AS Last, Name AS Name, Birthday AS BDay, CustomerType AS Type FROM Sales.Customer
WHERE Birthday IN ($rangeLastWeek)

This example uses the RANGEEND function in the WHERE clause, which will give you all the customers born since the end of last week:

SELECT FirstName AS First, LastName AS Last, Name AS Name, Birthday AS BDay, CustomerType AS Type FROM Sales.Customer
WHERE Birthday > RANGEEND($rangeLastWeek)