OQL RANGEBEGIN
Last modified: August 27, 2024
Description
The RANGEBEGIN
function extracts the initial 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:
RANGEBEGIN ( $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 RANGEBEGIN
function in the WHERE
clause, which will give you all the customers born since the beginning of last week:
SELECT FirstName AS First, LastName AS Last, Name AS Name, Birthday AS BDay, CustomerType AS Type FROM Sales.Customer
WHERE Birthday > RANGEBEGIN($rangeLastWeek)