Well, logically you can't AND the criteria together where you would like to do it. You can't have attributeid = 7 AND attributeid = 29. attributeid can only have 1 value per row. Can you post some sample data and the desired output? See the top link in my signature for an explanation of what will help me help you the most.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question