The Nasdaq fell on Friday following Microsoft Corp's disappointing quarterly results, but gains in pharmaceutical and energy shares held the Dow and the S&P 500 near break-even.

Microsoft shares fell 9 percent to $23.28, a day after the software maker posted quarterly revenue below Wall Street's estimates. Web retailer Amazon.com Inc also missed sales expectations, sending its stock down 8 percent to $86.38.

The results cast a cloud over what is largely shaping up to be a stronger-than-expected second-quarter earnings season.

Even so, investors took Wall Street's initial drop on Friday as an opportunity to scoop up shares in other sectors, including energy and big pharmaceuticals.

Microsoft is going through a product transition and no great visibility on the Windows franchise, but in general the tone this quarter for a good many companies has been strong, said Owen Fitzpatrick, head of U.S. Equity Group at Deutsche Bank Private Wealth Management in New York.

We are not probably going to see a major shift here in the negative direction, so it's probably going to be overall positive for earnings season.

The Dow Jones industrial average <.DJI> rose 0.75 points, or 0.01 percent, to 9,070.04. The Standard & Poor's 500 Index <.SPX> slipped 0.36 points, or 0.04 percent, to 975.93. The Nasdaq Composite Index <.IXIC> shed 14.27 points, or 0.72 percent, to 1,959.33.

Microsoft was the top drag on Nasdaq, followed by Amazon.com.

But all indexes were on track for a second straight weekly advance. Johnson & Johnson , up 1.5 percent, was the Dow's top boost.

Chevron Corp climbed nearly 1 percent to $68.52 as U.S. front-month crude oil prices bounced 1.4 percent to $68.12 a barrel.

Schlumberger Ltd warned that it didn't expect a rebound in spending by its oil- and gas-producing customers this year, but tool manufacturer Black and Decker Corp raised its full-year profit view.

Schlumberger's stock fell 2.3 percent to $56.46, while Black & Decker shares climbed 9.3 percent to $36.87.

Market gains were curbed by a report showing U.S. consumer confidence waned in late July to its lowest reading since April, according to the Reuters/University of Michigan Surveys of Consumers.

On Thursday, the S&P 500 closed at its highest level since Election Day in November, while the Nasdaq marked a winning streak of 12 straight days, its longest run since 1992.

(Reporting by Ellis Mnyandu; Editing by Padraic Cassidy)