President Donald Trump seemed to indicate in an interview on Wednesday that stock market gains reduce the national debt. They don't.

The president raised eyebrows in a sit-down with Fox News' Sean Hannity when he appeared to suggest that a record run for American markets is helping to reduce the United States' $20 trillion national debt. But that's not how it works. It would be like saying the sun is shining because it's Sunday -- sounds like they could be related, but they're not.

Here's Trump's full quote:

The country -- we took it over and owed over $20 trillion. As you know the last eight years, they borrowed more than it did in the whole history of our country. So they borrowed more than $10 trillion, right? And yet, we picked up $5.2 trillion just in the stock market. Possibly picked up the whole thing in terms of the first nine months, in terms of value. So you could say, in one sense, we're really increasing values. And maybe in a sense we're reducing debt. But we're very honored by it. And we're very, very happy with what's happening on Wall Street.

But growth in the stock market has no direct relationship to a decline in the national debt.

"Both of these are stocks of wealth, in some sense, one negative and one positive," said Marc Goldwein, senior policy director for the Committee for a Responsible Federal Budget. "But one is the negative wealth of the government, and the other is the positive wealth, collectively, of basically everyone, or a subset of that wealth that's in the stock market. These are unrelated."

The national debt is the total accumulation of the federal government's budget deficits, the annual measure by which government spending exceeds revenue. According to the U.S. debt clock calculator, the national debt is currently more than $20.3 trillion.

Under former President Barack Obama, the national debt did about double, as Trump said, but as the Committee for a Responsible Budget says, the explanation of why is complicated.

Some of the debt increase was already projected to occur before anything was signed by Obama, and the Great Recession caused hugged reductions in employment, wages and profits, which in turn resulted in reduced revenue and more automatic spending on items such as employment. Obama did sign laws worsening the debt situation, such as the 2009 stimulus and the extension of the Bush tax cuts. It is worth noting that those laws were written not by Obama but by Congress.

Image placeholder title

The debt stands to rise under Trump as well. While he has laid out spending cuts in his proposed budget, he has promised to leave Social Security and Medicare untouched and up defense spending. The tax plan he is proposing would increase the debt.

"He does have some smart ideas with his budget, but when you add them all up...they're not enough to pay for the tax plan, let alone reduce the debt," Goldwein said.

Trump has made a habit of touting the stock market's rise as president and using it as a measure of his success. He apparently uses as his measure the Wilshire 5000, which tracks all of the stocks actively traded in the United States.

He's right that markets have done well since his election, but not, historically, the best. Trump ranks seventh in S&P 500 performance the first 11 months after his election, behind Presidents Franklin D. Roosevelt (who beats him out twice), Bill Clinton, Herbert Hoover, George H.W. Bush and John F. Kennedy.

While what Trump is saying on the debt and the stock market, separately, is technically correct, tying them together doesn't make sense.

One could perhaps make a tenuous connection that capital gains and dividend taxes contribute to revenue, but it's hardly enough to reduce the deficit and, therefore, debt. Moreover, his tax plan is silent on capital gains.

Risks that the U.S. would default on its creditors if it were for some reason unable to pay off its debts (if, for example, Congress refuses to address the debt ceiling) would certainly rock markets. But that doesn't appear to be what Trump is talking about, either. 

To be sure, this is not the first time the president, a Wharton graduate, appears to have confused financial concepts that seem or sound alike.

In an April 2016 interview, he claimed he would be able to get rid of the nation's entire debt, at that time $19 trillion, in a period of eight years by "renegotiating all of our deals, the big trade deals we're doing so badly on."

While speaking alongside South Korean President Moon Jae-in, he appeared to conflate trade deficits with the budget deficit. "The United States has trade deficits with many, many countries, and we cannot allow that to continue...with South Korea right now, but we cannot allow that to continue," he said. "This is really a statement that I make about all trade: For many, many years the United States has suffered through massive trade deficits; that's why we have $20 trillion in debt."

More of What's Trending on TheStreet:

Editors' pick: Originally published Oct. 12.