If you would provide table definition, some sample data and required result based on the sample data, then some one will be able to assist you with a tested solution.
Click on the first link in my signature block to read how to prepare the above in a short simple manner.
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please read[/url]
Before posting a performance problem please read[/url]