NEW YORK (AP) -- Big gains for banks and transportation companies like airlines and railroads took U.S. stock indexes slightly higher Wednesday. Other parts of the market didn't move much.
United Continental had its best day in two years after it said strong demand is resulting in higher ticket prices, while railroad company CSX said it's still cutting costs and improving operations. Their competitors also jumped.
Banks and other financial companies got a boost from strong second-quarter results, and Warren Buffett's Berkshire Hathaway made its biggest gain in almost seven years after it loosened its rules on stock buybacks.
Brad McMillan, chief investment officer for Commonwealth Financial Network, said the combination of strong consumer spending, rising business investment and good economic data is likely to lead to another quarter of strong earnings growth.
"Everything is going right at the moment," he said. "This quarter's earnings are going to reflect that."
The S&P 500 index rose 6.07 points, or 0.2 percent, to 2,815.62. The Dow Jones Industrial Average added 79.40 points, or 0.3 percent, to 25,199.29. The Nasdaq composite fell 0.67 points to 7,854.44. The Russell 2000 index of smaller-company stocks gained 4.61 points, or 0.3 percent, to 1,691.87.
Stocks have been rising this month, even as trade tensions with China continue to mount, as investors anticipate solid second-quarter earnings reports from U.S. companies. The S&P 500 is up 3.6 percent so far in July.
United Continental surpassed Wall Street projections and said strong demand is resulting in higher prices as the summer travel season sets in. Its stock surged 8.8 percent to $79.
CSX said its profit climbed 72 percent in its latest quarter as it kept cutting costs and improving its operations. The results were stronger than analysts expected and the stock added 7.1 percent to $69.
Maintenance supply company W.W. Grainger made the biggest gain on the S&P 500 after it blew past analysts' estimates in the latest quarter. The company posted strong growth in the U.S. with more business with both large and medium size customers and it raised its forecasts for the year. The stock jumped 11.2 percent to $338.99.
Berkshire Hathaway, the conglomerate that owns GEICO and other insurance companies, jumped as investors hoped it would give some of that money back to shareholders by buying back its own stock. The company had $108 billion in cash and short-term investments as of March.
Berkshire's Class B shares jumped 5.3 percent to $200.44 in heavy trading. Other financial companies including Morgan Stanley, M&T Bank and Northern Trust climbed after their quarterly reports.
Federal Reserve Chairman Jerome Powell wrapped up his testimony to Congress about economic and monetary policy. He said the trade war with China might make inflation speed up, but continued to express a very positive view of the state of the economy overall.
McMillan, of Commonwealth, said that Powell's comments were so upbeat that he wonders if the Fed is really reckoning with the risks posed by tariffs and higher interest rates.
"I've never seen a central bank look quite that confident, and frankly it makes me nervous," he said.
While investors are focusing more on company earnings than trade policy at the moment, U.S. uranium mining companies rose after the Commerce Department started an investigation into the impact of uranium imports on U.S. national security. That could result in tariffs, similar to the investigation into steel and aluminum imports that resulted in big taxes on steel from the European Union, Canada, Mexico and Japan.
Energy Fuels, one of the companies that requested the investigation, rose 3.9 percent to $1.60. Uranium Energy added 1.3 percent to $2.34.
The European Union fined Google a record $5 billion Wednesday for using the market dominance of its Android mobile operating system to force handset makers to install Google apps, reducing choice for consumers. The company said it plans to appeal the ruling. A year ago, EU regulators fined Google $2.8 billion for favoring its shopping listings in search results.
Shares of Alphabet, Google's parent company, took a small loss and closed at $1,212.91.
Bond prices slipped. The yield on the 10-year Treasury note rose to 2.88 percent from 2.86 percent. That sent big-dividend stocks like household goods companies and utilities lower.
Benchmark U.S. crude recovered from an early loss and rose 1 percent to $68.76 a barrel in New York. Brent crude, used to price international oils, added 1 percent to settle at $72.90 a barrel in London. U.S. crude has tumbled 8 percent in July but is still up 42 percent over the last 12 months.
Wholesale gasoline climbed 0.9 percent to $2.04 a gallon. Heating oil gained 1 percent to $2.09 a gallon. Natural gas fell 0.7 percent to $2.72 per 1,000 cubic feet.
Gold was little changed and closed at $1,227.90 an ounce. Silver fell 0.3 percent to $15.57 an ounce. Copper rose 0.5 percent to $2.76 a pound.
The dollar inched up to 112.83 yen from 112.83 yen. The euro fell to $1.1646 from $1.1664.
Germany's DAX added 0.8 percent and the British FTSE 100 rose 0.7 percent. The CAC 40 in France gained 0.5 percent.
Japan's benchmark Nikkei 225 gained 0.4 percent and the Kospi in South Korea lost 0.3 percent as the country's government downgraded its forecasts for job creation and growth. Hong Kong's Hang Seng shed 0.2 percent.