datetime.date.year_monthISO 8601 truncated form with no day component. Pervasive in monthly time-series data, financial reporting, and API responses. Transforms to first day of month.
$ finetype infer -i "2024-01"
→ datetime.date.year_monthSELECT finetype('2024-01');
-- → 'datetime.date.year_month'strptime({col} || '-01', '%Y-%m-%d')::DATE
-- Format: %Y-%m-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS DATE) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'datetime.date.year_month';month: CAST(SUBSTRING({col}, 6, 2) AS INT)
year: CAST(SUBSTRING({col}, 1, 4) AS INT){
"$id": "https://meridian.online/schemas/datetime.date.year_month",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "ISO 8601 truncated form with no day component. Pervasive in monthly time-series data, financial reporting, and API responses. Transforms to first day of month.",
"examples": [
"2024-01",
"2023-12",
"2000-06"
],
"maxLength": 7,
"minLength": 7,
"pattern": "^\\d{4}-\\d{2}$",
"title": "Year-Month (ISO truncated)",
"type": "string",
"x-finetype-broad-type": "DATE",
"x-finetype-format-string": "%Y-%m",
"x-finetype-transform": "strptime({col} || '-01', '%Y-%m-%d')::DATE"
}2024-012023-122000-06