Department stores kicked off earnings season on a positive note on Thursday morning, and Nordstrom (NYSE:JWN) continued the parade of good news on Thursday afternoon. The upscale retailer posted solid sales growth and a strong margin performance for Q3.

Retail Department Stores Nordstrom Jwn

Nordstrom's sales and earnings beat expectations in Q3. Image source: Nordstrom.

However, smaller department store chain Dillard's (NYSE:DDS) didn't fare as well, posting another decline in sales and a sharp drop in net income. The contrasting results from these two chains show that Nordstrom's heavy investments are starting to pay off, whereas Dillard's may be falling behind due to its stingy investing habits.

Nordstrom has a successful quarter

Last quarter, Nordstrom benefited from the timing of its Anniversary Sale -- its biggest sale event of the year -- which helped it grow revenue 7.2% year over year on a 2.4% increase in comparable store sales. Adjusted EPS reached $0.84, up from $0.57 a year earlier.

However, there was more to Nordstrom's strong results than the timing of this sale. First, looking at the second and third quarters combined to neutralize the impact of the sale's timing, Nordstrom still posted respectable sales growth of 3.3%, on a 0.4% comp sales increase.

Second, Nordstrom's gross margin rose to 34.8% from 33.9% in Q3 2015. The company has done a much better job of managing its inventory in the past two quarters, thereby avoiding the need for margin-sapping clearance discounts. Indeed, by the end of Q3, inventory was flat year over year, whereas it was up 12% to start the year. This improvement in inventory management should help Nordstrom continue to post strong profitability in the next few quarters.

Third, Nordstrom has improved its cost structure this year, recognizing that its sales growth is moderating. This will allow the company to maintain and even gradually expand its profit margin with mid-single-digit sales growth.

Retail Department Stores Nordstrom Trunk Club Jwn

Trunk Club has been a money loser for Nordstrom thus far. Image source: Nordstrom.

During Q3, Nordstrom did have to take a $197 million writedown on Trunk Club, a promising start-up that it bought two years ago. While Trunk Club is still growing at a healthy rate, Nordstrom has had trouble getting the business to turn a profit. However, its recent decision to integrate the Trunk Club and Nordstrom supply chains should help in that respect.

Dillard's troubles continue

Meanwhile, Dillard's is still struggling to stay relevant. Over the past year, Dillard's has faced slumping sales and a collapse in its profit margin. Through the first three quarters of fiscal 2016, adjusted net income has plummeted 37% year over year. In Q3, adjusted EPS plunged to $0.67 from $1.03 a year earlier, missing analysts' expectations.

Dillard's will face easier comparisons going forward, but it's troubling that its sales and earnings trend didn't improve at all in Q3. The only good news the company has been able to offer lately is that it continues to buy back lots of stock as its share price has fallen. But unless Dillard's can stabilize its profitability, these share buybacks won't increase shareholder value.

It pays to invest

Nordstrom raised its full-year adjusted earnings guidance on Thursday, based on its strong Q3 results.

Looking ahead to 2017, Nordstrom will continue to benefit from solid e-commerce growth thanks to its massive investments in technology and fulfillment. Furthermore, its investments in rapidly expanding the Nordstrom Rack off-price chain and opening stores in Canada should start to mature in 2017, driving an increase in profitability.

Retail Department Stores Nordstrom Rack Jwn

The Nordstrom Rack chain has expanded dramatically in recent years. Image source: The Motley Fool.

While Nordstrom has been investing heavily for the past few years to adapt to the changing retail environment, Dillard's has been extremely frugal. For example, Dillard's currently plans to spend just $100 million on capex this year, compared to $800 million or more at Nordstrom -- despite the fact that Dillard's has significantly more retail square footage.

Dillard's tight-fisted approach to capex has allowed it to produce plenty of free cash flow in recent years. Now it may be paying the price. The recent sales trends at Dillard's aren't all that different from what Nordstrom is experiencing in its full-line stores. But Nordstrom can fall back on its fast-growing online and off-price businesses for growth. By contrast, if mall traffic continues to decline, there could be a lot more pain ahead for Dillard's.

Adam Levine-Weinberg owns shares of Nordstrom. The Motley Fool recommends Nordstrom. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.