--- title: "FLOORMIN(A,B)" slug: "floorminab" updated: 2022-02-10T19:53:01Z published: 2022-02-10T19:53:01Z canonical: "docs.datajet.app/floorminab" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # FLOORMIN(A,B) ## Engineering Functions: [FLOORMIN(A,B)] ## Rounds a DateTime field down to a given interval, i.e., down to the nearest hour, 15 mins… `FLOORMIN = Date &" " & Hour &":" & INT(Mins/Interval) * Interval &":00"` *Where* Date = The DATE portion of Field A Hour = The HOUR portion of Field A Mins = The MINUTE portion of Field A Interval = The INTERVAL, in minutes, denoted by B ## Purpose Use this function to: - segment data into time intervals ## Return Value | **FieldType** | DateTime | | --- | --- | | **FieldSize** | Continuous | | **DataType** | Continuous | | **DataSize** | LongInteger | `2020-11-06 14:45:00` ## Parameters | **Component** | **JSON** | **Description** | | --- | --- | --- | | #### **Table** | “targetTable”: “MyTableName” | The target table on which the new field will be created | | **Filter** | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter Recordset will be returned as null. | | **DateTimeFunction** | “p1”: “FLOORMIN(A,B)” | FLOORMIN(A,B) | | **A** | “p2”: “TimeStampFieldName” | The DateTime field to segment | | **B** | “p3”: “#INTERVAL” | FLOORMIN is used with an explicit interval value. e.g. #15 - allocates to previous 00, 15, 30, 40 minute interval. #20 - allocates to previous 00, 20, 40 minute interval #27 - allocates to previous 00, 27, 54 minute interval | ## JSON sample ```json { "method": "BuildBakedField", "project": "Election8", "targetTable": "PA_All", "overwrite": true, "name": "ts_15", "function": "datetimetransform", "p1": "FLOORMIN(A,B)", "p2": "TimeStamp", "p3": "#15" } ``` ## Usage Notes ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1634109090551.png) ## Example | ### Segment timestamp data into 15 minute segments | | --- | | - Table: = PA_All - **Function: = DateTimeTransform** - **DateTimeFunction: = FLOORMIN(A,B)** - A:= TimeStamp - B: = #15 | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1634109090579.png) |