Advance to the Rear is a 1964 film directed by George Marshall and starring Glenn Ford, Stella Stevens, Melvyn Douglas, Jim Backus, Joan Blondell, Andrew Prine (who has a Star Trek connection), Alan Hale, Jr. (a favorite of ours) and Whit Bissell (who has an original series Star Trek connection). It is a Civil War-era comedy that takes place out west. I found it too boring to finish.
Googlevideo has it online:
The New York Times does not like it. MSN has an overview, as do TCM and AMCTV.