Not drinking in middle age can increase the risk of dementia as much as drinking too much, according to a report.

The study tracked the drinking habits of 9,000 London civil servants between the ages of 35 and 55 from 1985 to 1993.

They were then monitored for, on average, another 23 years. In total there were 397 cases of dementia identified through hospital, mental health services and mortality records.

Published in the British Medical Journal (BMJ) the data showed abstinence in midlife was associated with a 45% higher risk of dementia compared with people who consumed between one and 14 units of alcohol per week.

With people who drank more than 14 units a week the dementia risk increased by 17% with every additional seven units per week.

2:28

Video:Scotland charges min 50p per unit of alcohol

However, the report's authors concluded that the underlying mechanisms leading to dementia for heavy drinkers and those abstaining were probably different.

The study did not take into account the subjects' drinking habits before middle age.

Dr Sara Imarisio, head of research at Alzheimer's Research UK, said: "As this study only looked at people's drinking in midlife, we don't know about their drinking habits earlier in adulthood, and it is possible that this may contribute to their later life dementia risk.

"People who completely abstain from alcohol may have a history of heavy drinking and this can make it difficult to interpret the links between drinking and health.