Answered
STUCK - Indexing a List and using the index as a variable
Howdy everyone. I would imagine this is not a tough task but I cannot find information on exactly what I need to accomplish.
Let's say I have a table with fruit. Field names fruitid and fruitname.
I query select * from fruit order by fruitname. Then I take this data and create an list (or array?) with the fruitnames.
What I want to do is is list the results with their place in the list or array. Not their fruitid. For example:
1 Apple
2 Orange
3 Pear
2 Orange
3 Pear
Where the 1,2,3 is the order of the list and not any data retrieved form the query. I need to use the 1,2,3 as variables separately form the Apple,Orange,Pear.
I have been poking around in the online help, CFWACK and finding information on indexed lists is eluding me. I was looking at listgetat but the results will be different every time and it did not seem like the solution as ListGetAt returns the variable... for example:
Apple Apple
Orange Orange
Pear Pear
Any thoughts? Any help in a new direction is welcome. I am using CF7.01 on WinServer2003 and SQLServer2008.
