Investors & landlords

No, you can't.  Unless you did a 1031 exchange, which is a complex process that you would have been aware of, these are independent transactions.  Sold in 2018, reported in 2018.