GenealogyBank has the core military reference books that you will rely on in documenting your ancestors with military service.
For example GenealogyBank has the two volume set:
Heitman, Francis B. Historical Register and Dictionary of the United States Army, from its Organization, September 29, 1789, to March 2, 1903. Washington, DC: Government Printing Office, 1903. 2 volumes. (Serial Set Vol. No. 4535, Session Vol. No.96; Report: H.Doc. 446 pt. 1 & 2).
This handbook has the military record of all Army officers from 1789 to 1903 and the details on all battles fought by the Army during that same period.
Another standard reference book for documenting US Army officers is:
The Centennial of the United States Military Academy at West Point, New York. Washington, DC: Government Printing Office, 1904. 2 volumes. (Serial Set Vol. No. 4751, Session Vol. No.125; Report: H.Doc. 789 pt. 1 & 2).