--- title: "Tools.Range" slug: "toolsrange" tags: ["luminesce ", "provider"] updated: 2024-08-23T04:50:39Z published: 2024-08-23T04:50:39Z canonical: "support.lusid.com/toolsrange" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.lusid.com/llms.txt > Use this file to discover all available pages before exploring further. # Tools.Range | **Type** | **Read/write** | **Author** | **Availability** | | --- | --- | --- | --- | | [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Read | Finbourne | Provided with LUSID | The `Tools.Range` provider enables you to write a [Luminesce query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that provides a simple range of values. > **Note:** The LUSID user running the query must have sufficient [access control permissions](/v1/docs/creating-policies-to-control-access-to-providers-for-different-luminesce-end-users) to use this provider. This should automatically be the case if you are the domain owner. You can use this provider in conjunction with other providers to generate a range of values for further querying, [see example 3](/v1/docs/toolsrange#example-3-generating-a-range-of-dates-to-fetch-lusid-logs-from). ## Basic usage ```sql select * from Tools.[Range] where ``` ## Query parameters `Tools.Range` has parameters that enable you to filter or refine a query. To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries): ```sql select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Tools.Range' and FieldType = 'Parameter'; ``` ## Data fields By default, `Tools.Range` returns a table of data populated with particular fields (columns). You can return just a subset of these fields if you wish. To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries): ```sql select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Tools.Range' and FieldType = 'Column'; ``` > **Note:** Fields marked 'primary key' are returned by queries that start `select ^ from Tools.[Range]...` ## Examples ### Example 1: Generating a default range of values ```sql select value from Tools.[Range] ``` The table of data returned by the query shows one column with values from 1 to 100. ### Example 2: Generating a range of 4 values which start from 5 and increment by 3 ```sql select * from Tools.[Range] where start = 5 and number = 4 and step = 3 ``` The table of data returned by the query looks like this: ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/5a269bfc-ef58-47c6-ba70-9cf67e0c9535.png?sv=2026-02-06&spr=https&st=2026-11-04T02%3A13%3A47Z&se=2026-11-04T03%3A13%3A47Z&sr=c&sp=r&sig=1UE%2FkHWq%2Fr8IwR1xzadsgwJqtGyl%2BnCjbjmKAZtgfu8%3D) ### Example 3: Generating a range of dates to fetch LUSID logs from In this example, `Tools.Range` is used to generate dates for the previous three days, which are then passed into the `Lusid.Logs.AppRequest` provider to fetch all [GetValuation](https://www.lusid.com/docs/api/lusid/endpoints/aggregation/GetValuation.html) request logs for each day in this time range. ```sql @days = select    date('now', '-' || Value || ' days') as datetime1,    date('now', '-' || Value || ' days', '+1 days') as datetime2 from Tools.[Range] where number = 3 and Start = 0; select    d.datetime1,    d.datetime2,    r.Timestamp,    r.Duration,    r.StatusCode from    @days as d    OUTER APPLY    (        select            ar.Timestamp, ar.Duration, ar.StatusCode        from            Lusid.Logs.AppRequest as ar        where            ar.StartAt = d.datetime1            and ar.EndAt = d.datetime2            and ar.Application = 'lusid'            and ar.EventType = 'Completed'            and ar.Method = 'GetValuation'    ) r ; ``` The table of data returned by the query looks like this: ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/d92ab4c5-d707-4902-b7fc-47bac9783be0.png?sv=2026-02-06&spr=https&st=2026-11-04T02%3A13%3A47Z&se=2026-11-04T03%3A13%3A47Z&sr=c&sp=r&sig=1UE%2FkHWq%2Fr8IwR1xzadsgwJqtGyl%2BnCjbjmKAZtgfu8%3D)