Q: I've read that you shouldn't invest in stocks unless you have five or more years to let your investments ride out the ups and downs. The problem is that I might need my money within a year or two. What should I invest in?

You should keep money you might need out of the stock market. In fact, I'd even consider a five-year time horizon to be rather short.

The reason? While stocks have historically produced the best returns of any asset class when you're measuring in decades, the year-to-year fluctuations in the stock market can be large and unpredictable. Statistically speaking, losses of as much as 23% or gains of as much as 45% in a single year wouldn't be considered unusual.

If you might need your money in the near future, capital preservation should be your biggest priority, so it's probably best to focus on investment options that don't put your principal at risk whatsoever.

Fortunately for short-term investment purposes, interest rates have gone up considerably, so it's possible to get some decent returns from vehicles like CDs. As I write this, you can get a one-year CD with an annual percentage yield (APY) as high as 2.8% from a highly reputable financial institution, and a two-year CD with a 3% APY is readily available. Even if you don't want your money tied up for any specific length of time, you can get as much as 2.3% from an online savings account.