I have to look this one up every time. You can use cfscript to loop over a query by doing the following:
2
3}
4
5OR
6
7for (var i=1; i <= qry.recordcount;i = i+1) {
8
9}
You notice a slight difference between the part that increments. The top one has an 'i++' the bottom has 'i+1'. I am pretty sure these do the same thing but later version sof coldfusion allowed you to use the double plus sign ++ to increment by 1.
I got stuck half way between and had i=i++. That put my loop into eternal running mode and I had to keep stopping the application to make the thing quit running. I am embarrassed how long this stumped me. So don't do that.