I dont have Td access. However, I see that you can use something like(just a logic sort)
Thanks Raja.. I got the logic. Btw what is way to do it in report? based on that I can choose whether to keep it in db level or move to reports. Thanks again.
I look from many perspectives, infrastructure etc etc. Every reporting tool allows you to write and manipulate code with drag and drop and put the logic you want. However, I feel you may want to finish it in style :) , so I feel it is better to put in query for various reasons-say, when I worked in one project to make change in one report field logic, it takes a lot of doing. I hate it. This is just one of the reasons, but there are many more based on env.