What exactly are you trying to do here?
Can you please post better data, DDL and DML statements. You'll get more help if you follow the suggestions in this Post www.sqlservercentral.com/articles/Best+Practices[/url].
Also Post what you have tried, and we can go from there