I was referring to the inner query using the full scoped name - variables.queryName.
So, why does setting newQueryName = variables.queryName PRIOR to looping the first query change anything? Both variables are in the variable scope and are created prior to the first loop - they should be the same right? BTW - copying the query over to a new name worked. Now the question is why? Thanks -----Original Message----- From: Keith Dodd [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 3:17 PM To: CF-Talk Subject: Nested Query Loops Not sure this is the problem, but I've had problems with nesting loops, forgetting that you need to set a variable from the outer loop (with a new name) before using that variable in the inner loop. I don't understand why, but variables get confused in nested loops. This *might* have something to do with it. Keith Dodd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm