If program is a query it cannot be accessed that way. Can you show what that query looks like.
On 14/08/2012, at 6:33 AM, "Rob Voyle" <[email protected]> wrote: > > Hi Folks > > I have a database that contains amongst others things 7 discount options and > values as separate fields (discountReason1, discountValue1, discountReason2, > discountValue2, etc. I created a query called program which works fine. > However > I am trying to loop over the discounts and getting strange results. > > <cfloop from="1" to="7" index="d"> > <cfif program['discountValue' & d] is not "0"> > <p><b>#program['discountReason' & d]#</b> value: > $#program['discountValue' & d]#</p> > </cfif> > </cfloop> > > gives "Complex object types cannot be converted to simple values" error. > > Whereas: > > <cfloop from="1" to="7" index="d"> > <cfif evaluate('program.discountValue' & d) is not "0"> > <p><b>#evaluate('program.discountReason' & d)#</b> value: > $#evaluate('program.discountValue' & d)#</p> > </cfif> > </cfloop> > > Works just fine > What am I missing in the first example. > Thanks > Rob > Robert J. Voyle, Psy.D. > Director, Clergy Leadership Institute > For Coaching and Training in Appreciative Inquiry > Author: Restoring Hope: Appreciative Strategies > to Resolve Grief and Resentment > http://www.appreciativeway.com/ > 503-647-2378 or 503-647-2382 > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:5884 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm
