All tables
tables · table

icsfreqperiod

The icsfreqperiod table functions as a master reference/lookup table for defining temporal frequencies and their equivalent duration in days. It is primarily used to facilitate date calculations for recurring events such as machine maintenance, gauge calibration, or scheduling by providing a numeric "period" multiplier for string-based frequency labels (e.g., converting "month" to 30 days).

Row count
3
Last entry
Source
tables

Columns

4
ColumnTypeNullableMeaning
indexintegerNoPrimary key; unique identifier for the frequency record.
freq_periodstringYesThe descriptive name of the time unit.
periodnumberYesThe numeric value representing the duration in days.
compcodestringYesCompany Code; used for multi-tenant data partitioning.

Full documentation

### 1) Overview
 The `icsfreqperiod` table functions as a master reference/lookup table for defining temporal frequencies and their equivalent duration in days. It is primarily used to facilitate date calculations for recurring events such as machine maintenance, gauge calibration, or scheduling by providing a numeric "period" multiplier for string-based frequency labels (e.g., converting "month" to 30 days).
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary key; unique identifier for the frequency record. | 0, 1, 2... | `PRIMARY KEY` |
 | **freq_period** | string | Yes | The descriptive name of the time unit. | "day", "month", "year" | Used in UI dropdowns and joins to scheduling tables. |
 | **period** | number | Yes | The numeric value representing the duration in days. | 1.0, 30.0, 365.0 | Used as a multiplier for date-add calculations. |
 | **compcode** | string | Yes | Company Code; used for multi-tenant data partitioning. | "DAS" | `JOIN`, `WHERE` filter |
 
 ### 3) Relationships & Join Map
 
 The table serves as a supporting reference for tables requiring frequency-to-day conversions.
 
 **Authoritative Joins (via SCHEMA_MAP):**
 * **dbo.icsgaugemaster** (`frequency_period`): Joins on `icsfreqperiod.freq_period = icsgaugemaster.frequency_period`. This link is used to calculate the `next_due_date` for gauge calibration based on the `issue_date` and the numeric `period`.
 * **Global Filters** (`compcode`): Most tables in the schema (e.g., `dbo.CompanyConfig`, `dbo.machine`, `dbo.itemmas`) contain a `compcode` column and can be filtered alongside this table to ensure company-specific logic.
 
 **Likely Joins (Inferred):**
 * **dbo.machine** (`OilChangeFreq`, `PMFeq`): Likely used as a lookup to determine the numeric threshold for machine PM (Preventative Maintenance) schedules, though the column names do not match exactly.