In the blood stream are the red blood cells, which are made of a chemical, haemoglobin. Sugar sticks to the haemoglobin to make a "glycosylated haemoglobin", called haemoglobin A1C or HbA1C. The more sugar in the blood, the more haemoglobin A1C or HbA1C will be present in the blood.
Red cells live for 8 -12 weeks before they are replaced. By measuring the HbA1C it can tell you how high your blood sugar has been on average over the last 8-12 weeks. A normal non-diabetic HbA1C is 3.5-5.5% (this varies between hospitals). In diabetes 4-6% is acceptable.
The HbA1C test is currently one of the best ways to check diabetes is under control; it is the blood test that gets sent to the laboratory, and it is done on the spot in some hospital clinics. Remember, the HbA1C is not the same as the sugar level.
Coincidentally the sugar/HbA1C numbers for good control are rather similar though: sugar levels 5.5-6.5 mmols/l half an hour before meals versus 7% HbA1C.