The "hint" might not have put you in the right direction.
So here's a straight advice: please read and follow the instructions provided in the first link in my signature.
Ready to use sample data together with the expected result set will help us help you.
Pleae remember, we're all volunteers here willing to help. Some of us base their decision regarding the thread they'll put their effort to on the effort the person that opened the thread did invest.
The less time you invest to provide information the less are the chances to get an coded solution.