Could anyone advice how to use OQL RANGEEND & RANGEBEGIN?

0
I can’t get detail of usage, could anyone give me a sample OQL,  when do we need use them? what type is input parameter? what is return type, both really confuse me.    https://docs.mendix.com/refguide/oql-rangebegin
asked
1 answers
0

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). So if you trying to use this for a standalone oql command, you will not succeed.

Create a dataset and you can use RANGEBEGIN and RANGEEND. An example of using a range in an OQL, where $range is set to last week, which will  give you all customers born in the last week is:

select FirstName as First, LastName as Last, Name as Name, Birthday as BDay, DiedAt as DDay, CustomerType as Type from Sales.Customer
where Birthday IN ($rangeLastWeek)

Same example, but using function RANGEBEGIN in the where-clause, which will  give you all customers born since the start of last week, is:

select FirstName as First, LastName as Last, Name as Name, Birthday as BDay, DiedAt as DDay, CustomerType as Type from Sales.Customer
where Birthday > RANGEBEGIN($rangeLastWeek)
answered