what are the military ranks for the service members who served until 1865-09?
(AND military.rank (JOIN military.rank.used_by_services (ge military.military_service.to_date 1865-09^^http://www.w3.org/2001/XMLSchema#gYearMonth)))