A detective sergeant has been jailed for 18 months for sexual assaults on two colleagues.