how to "loop" it depends on what "process" you intend to
"do"...
if all "processes" are same except for each uses a different
tabshow
value, you can loop it (e.g. looping from=149 to=144 using
step="-1" in
your loop and <cfbreak> to break out of if a query
inside the loop
returns any records); if not... maybe a generic code like
below can work
for you:
<cfquery name="getqry1">
select test from testtable where tabshow = 149
</cfquery>
<cfif getqry1.recordcount gt 0>
<cfoutput query="getqry1">
do your process 1
</cfoutput>
<cfabort>
</cfif>
<cfquery name="getqry2">
select test from testtable where tabshow = 148
</cfquery>
<cfif getqry2.recordcount gt 0>
<cfoutput query="getqry2">
do your process 2
</cfoutput>
<cfabort>
</cfif>
and so on...
whether this works or not depends a lot on other code in your
page, i.e.
<cfabort> will stop ALL processing, including any
cfml/html code outside
this structure...
--
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com