Aim To develop a statistical model to identify determinants of glycemic control. Materials and methods A database was extracted from patients’ records with at least one glycated hemoglobin (HbA1c) analysis and with antidiabetic therapy established and stabilized. A logistic regression model was designed to identify the statistical significance of factors associated with glycemic control. Results Higher probability of success (HbA1c ≤8% [64 mmol/mol]) was found for those who were older in age, those who were men, and those with higher education levels. Increased values for the following variables were associated with the poorest glycemic control: number of years of T2DM since diagnosis, number of antidiabetic medicines, body mass index, low-density lipoprotein cholesterol, triglycerides, systolic blood pressure and number of diabetes consultations in the last twelve months. The following pharmacotherapeutic treatments were associated with glycemic control (in decreasing order of the results): oral antidiabetic drugs; oral antidiabetic drugs and insulin; insulin. Patients using metformin and a dipeptidyl peptidase-4 inhibitors have a higher probability of success than do patients using metformin and a sulfonylurea, and patients using insulin and metformin have a higher probability of success than do patients using insulin alone. Conclusions Sociodemographic, clinical and therapeutic parameters can strongly affect glycemic control. Studies based on real-life patient data provide important information on the development of more effective glycemic control.