Ecclesiastes 2:17-26 New King James Version (NKJV)
17 Therefore I hated life because the work that was done under the sun was distressing to me, for all is vanity and grasping for the wind.
18 Then I hated all my labor in which I had toiled under the sun, because I must leave it to the man who will come after me. 19 And who knows whether he will be wise or a fool? Yet he will rule over all my labor in which I toiled and in which I have shown myself wise under the sun. This also is vanity. 20 Therefore I turned my heart and despaired of all the labor in which I had toiled under the sun. 21 For there is a man whose labor is with wisdom, knowledge, and skill; yet he must leave his [a]heritage to a man who has not labored for it. This also is vanity and a great evil. 22 For what has man for all his labor, and for the striving of his heart with which he has toiled under the sun? 23 For all his days are sorrowful, and his work burdensome; even in the night his heart takes no rest. This also is vanity.
24 Nothing is better for a man than that he should eat and drink, and that his soul should enjoy good in his labor. This also, I saw, was from the hand of God. 25 For who can eat, or who can have enjoyment, [b]more than I? 26 For God gives wisdom and knowledge and joy to a man who is good in His sight; but to the sinner He gives the work of gathering and collecting, that he may give to him who is good before God. This also is vanity and grasping for the wind.
Ecclesiastes 2:17-26 New International Version (NIV)
Toil Is Meaningless
17 So I hated life, because the work that is done under the sun was grievous to me. All of it is meaningless, a chasing after the wind. 18 I hated all the things I had toiled for under the sun, because I must leave them to the one who comes after me. 19 And who knows whether that person will be wise or foolish? Yet they will have control over all the fruit of my toil into which I have poured my effort and skill under the sun. This too is meaningless. 20 So my heart began to despair over all my toilsome labor under the sun. 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? 23 All their days their work is grief and pain; even at night their minds do not rest. This too is meaningless.
24 A person can do nothing better than to eat and drink and find satisfaction in their own toil. This too, I see, is from the hand of God, 25 for without him, who can eat or find enjoyment? 26 To the person who pleases him, God gives wisdom, knowledge and happiness, but to the sinner he gives the task of gathering and storing up wealth to hand it over to the one who pleases God. This too is meaningless, a chasing after the wind.