--Stocks fall, reversing midday gains

--Europe ticks higher, despite Greek debt-solution delay; German economic expectations index declines

--Home Depot leads blue chips on better outlook; Microsoft slides

 
   By Matt Jarzemsky 
 

NEW YORK--U.S. stocks' gains fizzled Tuesday as the closing bell approached, as investors weighed a rally in home-improvement retailers with continued concerns about Greece's debt problem and the U.S. budget debate.

The Dow Jones Industrial Average added fell eight points, or 0.1%, to 12807 in late-afternoon trading, reversing earlier gains of as much as 83 points.

The Standard & Poor's 500-stock index eased one point, or 0.1%, to 1379. Technology and financial shares fell while consumer shares rose.

The tech-heavy Nasdaq Composite Index slipped 11 points, or 0.4%, to 2893.

Microsoft fell 3%, leading blue chips lower, after news that Steven Sinofsky, head of the software maker's Windows business, is leaving the company.

Home Depot added 3.7%, on pace to close at a 12-year high, after raising its 2012 earnings forecast on an improving housing market.

"We've been getting a little more defensive, going into a little bit more cash," said Paul Nolte, managing director at Dearborn Partners, in Chicago, which oversees $3 billion. "There's the 'fiscal cliff,' Europe is still not all there yet and the economic data we're seeing globally indicate weakness."

The so-called fiscal cliff, a combination of mandatory tax increases and spending cuts, is set to take effect at the start of next year if U.S. politicians can't reach a budget deal to avoid it.

European markets closed higher, alongside the earlier gains in U.S. stocks, with the Stoxx Europe 600 adding 0.4%. International Monetary Fund chief Christine Lagarde and Eurogroup President Jean-Claude Juncker disagreed on how Greece's debt should be tackled, weighing on sentiment.

A measure of German economic expectations for November fell well below economists' expectations, according to the Center for European Economic Research.

On the U.S. economic front, the National Federation of Independent Business said its small-business optimism index for October inched up in September, bucking economists' forecasts for a decline.

The federal budget deficit widened to $120 billion in October, the first month of the government's new fiscal year. The deficit compared with a $98.47 billion shortfall last year and was greater than economists' forecasts for $113 billion.

Asian markets also fell in response to concern about Greece. China's Shanghai Composite shed 1.5% and Japan's Nikkei Stock Average gave up 0.2% to record a seventh consecutive decline.

Crude-oil futures slipped 0.2% to settle at $85.38 a barrel, while gold futures lost 0.4% to settle at $1,724.20 an ounce. The dollar gained slightly against the euro but eased versus the yen.

Elsewhere in the corporate arena, Dick's Sporting Goods gained 4.8% after reporting quarterly results that topped its forecast and raising its current-year profit target.

Nanosphere gained 3.5% after the medical-test maker said the U.S. Food and Drug Administration cleared it to market a new diagnostic tool.

Write to Matt Jarzemsky at matthew.jarzemsky@dowjones.com