As expected, Wal-Mart (NYSE:WMT) had a solid second quarter. However, given upcoming challenges, it makes sense that some investors may want to say "when" on the discount retailer's stock, at least for the time being.

Wal-Mart's second-quarter net income increased 16.8% to $3.45 billion, or $0.87 per share. Net sales increased 10.4% to $101.6 billion. The discount behemoth's same-store sales zoomed up by 5% in the quarter. Even excluding fuel, comps increased 4.5%.

In addition, Wal-Mart was able to increase its guidance for earnings from continuing operations to a range of $3.43 per share to $3.50 per share for the full year.

Most people are well aware that many discounters, like Wal-Mart, Costco (NASDAQ:COST), and BJ's Wholesale (NYSE:BJ), have done quite well despite consumers' penny-pinching -- maybe Wal-Mart most of all. (Target (NYSE:TGT) has been what I've considered a surprising laggard.)

But it's not all hunky-dory. Wal-Mart said the current quarter could miss expectations given the difficulties that American consumers face right now.

Just last week, Wal-Mart was part of a storm of retail news when it missed July same-store sales expectations by a tad. It warned of coming slowness in consumer spending as the tax rebate funds dry up, and observed that many people were shopping on a paycheck-to-paycheck basis, elements it reiterated when discussing second-quarter results.

As much as Wal-Mart has never been one of my favorite retail stock ideas (in fact, for many years, it's probably been one of my least favorite), for nearly a year I've had to begrudgingly admit that the retailer is back in its element given the recessionary climate for consumers. And sure enough, Wal-Mart has been firing on all cylinders, and the second-quarter tidings speak well to that idea.

Then again, Wal-Mart's trading at 17 times trailing earnings, which strikes me as a premium for such a mature retailer (and far outpaces its growth rates). Its shares have surged a wild 34% over the last year. I'm thinking those investors who take Wal-Mart's "Save money. Live better" mantra to heart might want to wait around a bit for a cheaper opportunity -- when people are wigging out over Wal-Mart -- to buy the stock. That moment will likely come.   

Wal-Mart Stores is a Motley Fool Inside Value pick. Costco Wholesale is a Motley Fool Stock Advisor recommendation. Try any of our Foolish newsletters today, free for 30 days, and you'll see how the Fool can give you the stick you need to beat the market.

Alyce Lomax does not own shares of any of the companies mentioned. The Fool has a disclosure policy.