Ecclesiastes 2:18

New American Standard Bible (NASB)
Thus I hated all the fruit of my labor for which I had labored under the sun, for I must leave it to the man who will come after me.

Read Ecclesiastes 2:18 in other translations