Soldiers who have been in the trenches say that it’s true: There are no atheists in foxholes. Now there are data to quantify that adage.

A large-scale survey of World War II veterans indicates that the worse the fighting got, the more soldiers prayed. Indeed, the number rose from 42 percent to 72 percent.

Another survey of World War II vets finds that, 50 years later, those who experienced heavy combat displayed more religious behavior than those who saw no combat. Specifically, those who had a frightening war experience were 21 percent more likely to attend church. Those whose military experience was less terrifying were 26 percent less likely to attend church.

But other than reminding us of the sacrifices our military men and women make on behalf of their country, who’s going to benefit from this insight?

Cornell Food & Brand Lab, which conducted the research, usually focuses on how consumers relate to food and its packaging. It suggests that health care providers and counselors might find the information useful. Perhaps they would encourage patients to participate in spiritual activities to help deal with combat-related issues.

So the next time you want to thank a combat veteran, you might consider inviting him to a worship service.