By Allison Prang

Ecolab Inc. reported a loss for the second quarter, as it took a $2.1 billion charge for upstream energy business ChampionX, which has been separated from the company.

Ecolab said it had a net loss for the quarter of $2.04 billion, or $6.98 a share. Ecolab's profit the comparable quarter a year ago was $368.6 million, or $1.26 a share.

Adjusted earnings were 65 cents a share. According to FactSet, analysts expected 76 cents.

Net sales at the company were $2.69 billion, 15% lower than a year ago. Analysts were expecting $2.63 billion.

Chief Executive Douglas Baker Jr. said the company's "results were significantly impacted by COVID-19" and those effects "were most acutely felt in our Institutional business."

"We believe the second quarter is the low point for both the Institutional business and the company, and we expect sequential quarterly improvement for both leading into 2021," he said.

Write to Allison Prang at allison.prang@wsj.com