This idiom comes in various forms, e.g. seven ways from Sunday, nine ways from Sunday. There is also the version seven ways from sundown, which was also the title of an old (but good) movie. (The hero's name was 'Seven-ways-from-sundown Jones', but his friends just called him 'Seven'.)
They all just mean 'completely', e.g. I played tennis with Tom and beat him seven ways from Sunday.
The version with Seven/Sunday sounds better to me than Nine/Sunday, because of the alliteration.