In addition, your doctors will check a blood test called an A1c. This test measures the average sugar level in your blood over the last 90 days. This test is done on all patients with diabetes who are hospitalized.