Nasdaq Notches Another All-Time High

U.S. stocks eked out slight gains Tuesday as the Nasdaq Composite closed at another record and oil slipped from its two-week high.

Trading has been relatively quiet the past few weeks, even as major U.S. indexes have hit records. The S&P 500 hasn't had a daily move of 1% or more in either direction since July 8.

The broad index, along with the tech-heavy Nasdaq, surged to record highs on Friday after a strong jobs report, but many analysts and traders said they expect stocks to largely drift along in the coming weeks, especially as earnings season winds down.

"The market just keeps grinding along and moving in the same direction," said Lee Ferridge, head of macro strategy for North America at State Street Global Markets.

Data have largely indicated that the U.S. economy is growing at a moderate pace, albeit with a few hiccups. Productivity, measured as the output of goods and services produced by American workers per hour worked, decreased at a seasonally adjusted annual rate of 0.5% in the second quarter, the Labor Department said Tuesday. It marked the third consecutive quarter that productivity has fallen.

"As long as the economic story really stays the same, we'll keep having this benign drift where we set new highs every couple of weeks," said Katrina Lamb, head of investment strategy and research at MV Financial, which has $500 million in assets under management.

The Dow Jones Industrial Average rose 3.8 points Tuesday, or less than 0.1%, to 18533. The blue-chip index came within 10 points of its July 20 closing high of 18595.03 earlier in the session.

The S&P 500 added less than 0.1% and hit a new intraday high earlier in the session. The Nasdaq Composite climbed 0.2%.

U.S. crude oil fell 0.6% to $42.77 a barrel after fluctuating between losses and gains.

Write to Mike Bird at Mike.Bird@wsj.com