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 doesnât 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:6073
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm