Many years ago the ratio of military officers to soldiers and sailors was about the same as high school teachers to students in their classrooms. Imagine that in combat. It was probably somewhat disorganized. It raises questions about whether combat officers knew the status of their troops on the battlefield, and if they gave inaccurate casualty reports to high ranking senior officers. Now the ratio of military officers to soldiers and sailors is about 1 in 4 and so it's unlikely to happen.
This is a list of approximate casualties for 15 of our wars: The Revolutionary War (25,000 +/-), The Franco-American War (514), The War of 1812 (20,000+/-), The Mexican American War (13,283), The Civil War (750,000 to 850,000 troops plus about 250,000 civilians), The Spanish-American War (2,456), The Banana Wars (3,216), World War I (116,708), World War II (407,316), The Korean War (54,246), The Vietnam War (58,168), The Gulf War (293), Bosnia (12), Kosovo (2), Iraq (4,454 - 4,486).
We're not finished in Afghanistan yet and troops are still dying there. I've seen casualty reports that didn't include civilian contractor fatalities or soldiers who were killed away from the battlefield or suicides. The only way to know for sure how many casualties there are is to calculate the total number of Americans who went to Afghanistan and then subtract the number who returned to the U.S.. Even that number wouldn't be accurate because troops who were stationed outside of Afghanistan were killed by terrorists, too. For example, a lone wolf terrorist killed two troops in Germany. According to iCasualties.org, the total number is 2,322 but it's not clear which deaths it includes and which ones it doesn't.
Below are helpful websites on this topic:
The National Archives website's report titled, "Records of U.S. Military Casualties, Missing in Action, and Prisoners of War from the Era of the Vietnam War"