Overview
Thetab_meses table is a reference catalog containing the 12 months of the year. It’s used throughout the payroll system to ensure month values are valid and to provide month names for reporting.
Table Definition
Column Reference
Month number (1-12). Primary key.Constraint:
id_mes >= 1 AND id_mes <= 12Name of the month in Spanish. Must be at least 4 characters.Constraint:
LENGTH(nom_mes) >= 4Constraints
Primary Key
- id_mes: Unique month identifier (1-12)
Check Constraints
- id_mes: Must be between 1 and 12 (inclusive)
- nom_mes: Must be at least 4 characters long
Complete Month Data
The table contains all 12 months in Spanish:Month Reference
| id_mes | nom_mes | Quarter | Season (Colombia) |
|---|---|---|---|
| 1 | Enero | Q1 | Dry season |
| 2 | febrero | Q1 | Dry season |
| 3 | Marzo | Q1 | Dry season |
| 4 | Abril | Q2 | Rainy season |
| 5 | Mayo | Q2 | Rainy season |
| 6 | junio | Q2 | Rainy season |
| 7 | Julio | Q3 | Dry season |
| 8 | Agosto | Q3 | Dry season |
| 9 | Septiembre | Q3 | Rainy season |
| 10 | Octubre | Q4 | Rainy season |
| 11 | Noviembre | Q4 | Rainy season |
| 12 | Diciembre | Q4 | Dry season |
Usage Examples
Get Current Month Name
List All Months
Get Quarter Months
Validate Month Number
Related Tables
Thetab_meses table is referenced by:
tab_pmtros
Stores the current month for payroll processing:tab_novedades
References the month for payroll novelties:tab_nomina
References the month for final payroll:Reporting Examples
Payroll Summary by Month
Find Missing Payroll Months
Data Quality Notes
Notice that “febrero” and “junio” are lowercase in the sample data, while other months are capitalized. This inconsistency should be standardized in production:
This table is a static reference table and should be populated once during database initialization. The data rarely (if ever) changes.
Best Practices
- Keep month names consistent (all capitalized or all lowercase)
- Do not delete or modify month records as they are referenced by payroll data
- Use this table for month validation in application logic
- Join with this table in reports to display month names instead of numbers