A Barnsley man was found with cocaine by staff in a Mansfield night club while out on a works do, a court heard.
Lee Smith was detained at the Late Lounge, on Leeming Street, until police arrived at 9pm, on December 16.
In police interview he said he had bought £40 of the drug from a friend in Rotherham, but would not name him.
Smith, 22, of Chapel Street, Thunscoe, admitted possession of the Class A drug when he appeared at Mansfield Magistrates Court, on Wednesday.
Nigel Boddy, mitigating, said his client “deeply regretted” what he had done.
“It was a very tiny quantity of cocaine that was obviously for personal use,” he said.
Smith, now unemployed, was fined £40, and ordered to pay £85 court costs and a £15 victim surcharge.