0

Hi,
I am outputting a query into a table. I am listing titles of workshops, and dates and times.

If there is more than one date/time for a workshop, I add a separate row for each date/time. I would like to have all the rows for each workshop be the same color. Since the number of rows for each workshop varies, is there a way for me to find out if the previous row is for the same workshop?

Thank you!

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by lafalot
0

You could track the previous value yourself using a variable. Simply initialize it before your query loop starts. Inside the loop perform your comparison. Then update the variable with the current value the end of each loop.

<cfset previousWorkshop = "">
<cfoutput query="yourQuery">
   <cfif (some comparison with previousWorkshop here ...)>
       ... do stuff ...
   </cfif>

  <cfset previousWorkshop = currentWorkShop>
</cfoutput>

Alternately, you can access any valid query row using array notation #queryname["columnname"][ rownumber]#

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.