Code 1 creates an array of date values. Code 2 creates a 2D array. On row one of the output query, you do
<cfset dates[1][1] = X> You probably want <cfset dates[currentrow] = holidayDate> On Wed, May 22, 2013 at 1:45 PM, Lewis Billingsley <[email protected]>wrote: > > Hello, > I have two files that use the same code, except for how the initial > array is created. One works, the other gives me an error when I try to > work it into a dateDiff() > 1. The one that works creates the initial array like this: > <cfset dates = arrayNew(1)> > <cfset arrayAppend(dates, createDate(2013, 6, 1))> > <cfset arrayAppend(dates, createDate(2013, 6, 2))> > The <cfdump> shows an array with each date in one slot. > 2. The one that doesnt work gets the data from a query like this: > <cfset dates = arrayNew(1)> > <cfloop query="currentClosures"> > <cfset dates[CurrentRow][1] = holidayDate> > </cfloop> > It shows an error in the browser that says: > The value class coldfusion.runtime.Struct cannot be converted to a date. > And references the line that says: <cfif dateDiff("d", > newDates[arraylen(newDates)].last, dates[x]) is 1> > > The <cfdump> shows an array of structures with each date in one slot, > labeled as a structure. > It looks like this is what is giving me a problem. Can you tell me what I > can do to put the query results into an array without it being an array > of structures? I think if I can do that, I believe the rest of the code > will work. > Thanks much, Lewis > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:6074 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm
