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)