Ecclesiastes 2:21-23 NIV

21 For a person may labor with wisdom, knowledge and skill, and then they must leave all they own to another who has not toiled for it. This too is meaningless and a great misfortune.
22 What do people get for all the toil and anxious striving with which they labor under the sun?

References for Ecclesiastes 2:22

23 All their days their work is grief and pain; even at night their minds do not rest. This too is meaningless.

References for Ecclesiastes 2:23