Abstract:Objective To investigate the relationship between sleep quality, glycemic variability (GV) and glycemic control level in inpatients with type 2 diabetes mellitus (T2DM), and to analyze the influencing factors of glycemic control levels. Methods A total of 80 inpatients with T2DM admitted to the Second Affiliated Hospital of Bengbu Medical University from December 2025 to May 2026 were retrospectively included. The sleep quality was evaluated using the Pittsburgh sleep quality index (PSQI), and continuous glucose monitoring system (CGMS) was also adopted. Based on a total PSQI score of≥8 as the criterion, the subjects were divided into the sleep disorder group and the good sleep group. The baseline data and dynamic glycemic indicators of the two groups were compared. Moreover, the correlation between sleep parameters and glycemic control indicators and the influencing factors were analyzed by Pearson correlation analysis and multiple linear regression analysis. Results A total of 33 patients (41.25%) with sleep disorders were detected, and their total PSQI score was (12.8±2.7) points. In the good sleep group, 47 patients (58.75%) were detected, and their total PSQI score was (3.9±1.6) points. The difference of total PSQI score between the two groups was statistically significant (P<0.001). Compared with the good sleep group, the glycated hemoglobin A1c (HbA1c) and coefficient of variation (CV) were higher in the sleep disorder group (all P<0.01), and the time in range (TIR) was lower (P<0.01). Pearson correlation analysis revealed that the total scores of PSQI were positively correlated with HbA1c and CV (all P<0.01), and negatively correlated with TIR (P<0.01). The multiple regression analysis showed that HbA1c (β =0.35, P<0.01), total PSQI score (β =0.32, P<0.01), anxiety/depression state (β =0.21, P<0.05) were independent risk factors affecting CV in inpatients with T2DM. Conclusion The incidence of sleep disorders in inpatients with T2DM is high, and sleep quality is an independent factor affecting CV and glycemic control level.