If you have the “Program” name in one field, and the “Lesson” in a different field, what you could do is “Group by” Program, and then “Sort by” date. Any Lesson that is not associated with a Program would be in a group together with no Program name, and sorted by date. Any Lesson associated with a Program would be in a group with other Lessons in that Program, and sorted by date.
Try playing around with the Group menu to see if you can get something to work for you: