* Ceasefire declared in Gaza conflict
* Lenders fail to reach deal for Greece
* Investors remain wary of "fiscal cliff" impact
* St Jude shares slide 13 percent
* Dow up 0.4 pct, S&P 500 up 0.2 pct, Nasdaq up 0.3 pct
By Leah Schnurr
NEW YORK, Nov 21 U.S. stocks advanced on Wednesday after a ceasefire was declared to end the flare-up in violence between Israel and the Palestinians, though the lack of a deal to release aid to Greece kept a lid on gains.
Investors also remained anxious about the tax increases and spending cuts that are poised to come into effect in the new year - known as the "fiscal cliff" - though policymakers are not expected to get back to negotiations until after Thursday's Thanksgiving holiday.
Trading volume was light ahead of Thursday's market holiday. The stock market also will close early at 1 p.m. (1800 GMT) on Friday.
Greece's international lenders failed again to reach a deal to release emergency aid to the debt-saddled country. Lenders will try again next Monday, but Germany signaled that significant divisions remain.
A truce between Israel and Hamas gave stocks some support around midday after Egypt announced a ceasefire will come into effect later in the day.
Fears that the fiscal cliff discussions in Washington could be drawn out or yield no resolution have been at the forefront of investors' minds in recent weeks. Combined with concerns over the euro zone's continued debt problems, the worries had taken more than 5 percent off the S&P 500 since Election Day in early November.
Positive comments from U.S. politicians that they will work to find common ground have helped the S&P 500 recoup some of that loss in recent sessions.
"I think the focus is heavy on what are we doing about fiscal cliff," said Kurt Brunner, portfolio manager at Swarthmore Group in Philadelphia.
"Are these guys talking? Are there going to be substantive decisions made?"
St Jude Medical shares tumbled 13.3 percent to $30.96 after an inspection report from health regulators raised new safety concerns about one of the company's leads that are used with implantable defibrillators, analysts said.
A small gain in International Business Machines helped the Dow outperform the other indexes. IBM was up 0.7 percent at $190.47.
The Dow Jones industrial average added 49.35 points, or 0.39 percent, to 12,837.86. The Standard & Poor's 500 Index edged up 2.62 points, or 0.19 percent, to 1,390.43. The Nasdaq Composite Index gained 8.28 points, or 0.28 percent, to 2,924.96.
Salesforce.com Inc jumped 7.6 percent to $157.03 after the business software provider beat Wall Street's expectations for the third quarter and maintained its outlook for the rest of the year.
But Deere & Co dragged on the S&P 500 after the world's largest farm equipment maker reported a weaker-than-expected quarterly profit. Its stock lost 4 percent to $82.52.
The market did not derive much direction from the day's economic data, with initial jobless claims falling last week, as expected.
Other data showed manufacturing picked up at its quickest pace in five months in November, while consumer sentiment improved only slightly.
The focus will likely turn to retailers on Friday as analysts try to assess how strong the holiday shopping season will be this year, Brunner said. Holiday shopping traditionally kicks off the day after Thanksgiving, known as Black Friday, as stores offer deals and discounts to lure consumers.
The Pentagon releases photographs linked to allegations of abuse of detainees in Iraq and Afghanistan.