Investors & landlords

How do I handle the expenses when I spent a year (2020) fixing up the property and sold the property in another year say 2021?

Am I able to deduct any expenses on my 2020 taxes? If so how?

Thanks in advance for your reply.