Problems with double data

I have a list with activities. Everything works fine except the dates related to the activities. When I add dates to a certain activity it goes well, but in the out put I get the dates from the previous activities as well.

You can see an example of this here

So basically every activity takes the date(s) from the previous activity(s) as well:

This is my output for the dates:


							<cfoutput>
							<cfset variables.newDate = dateFormat( getActivities.activity_date, 'dd/mm' )>
							<cfset variables.datestr = ListAppend( variables.datestr, variables.newDate, ', ' & CHR(32) )>
							</cfoutput>
          		<p><b>#label3#:</b> <span>#variables.datestr#</span></p> 

I have no idea how to solve this

Hi ParkinT, this indeed gave me the right output. Thanks for that, but now I have problems when an activity has more than 1 date that only the last date shows up?

you seem to be appending the date from the first row of the getActivities query

that’s about as much as i can conclude, based on the code you’ve shown

by the way your sample page gives a 500 internal server error

Apparently, the ListAppend is building up “dateStr” with the new date APPENDED to itself. That is not what you want?

It has been a loooong time since I worked on ColdFusion, but I think if you use another variable for output, you will get what you want.
For example:


<cfset variables.outputVariable = ListAppend( variables.datestr, variables.newDate, ', ' & CHR(32) )>

AND


<p><b>#label3#:</b> <span>#variables.outputVariable#</span></p>

“The great thing about computers is that they do EXACTLY what you ask of them.
The trouble with computers is that they do EXACTLY what you ask of them.”