Yep what I mean is if we can see the column your retrieving then we can try adapt your code to suit.
Paul. On 14/08/2012 8:21 AM, Rob Voyle wrote: > * = all or have I got that wrong > Rob > > On 14 Aug 2012 at 8:09, Paul Kukiel wrote: > >> Thanks but what is the * >> >> You should ALWAYS individually select you column names. >> >> >> On 14/08/2012 8:04 AM, Rob Voyle wrote: >>> Here is the query >>> <cfquery datasource="appreciativeway" name="program"> >>> Select * >>> from programs >>> where programCode=<cfqueryparam cfsqltype="cf_sql_varchar" >>> value="#prog#"> >>> </cfquery> >>> >>> >>> >>> On 14 Aug 2012 at 7:27, Paul Kukiel wrote: >>> >>>> 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 >>>> >>> >>> >>> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ~| >> 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: >> 5886 >> Subscription: >> http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm >> Unsubscribe: >> http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm >> > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:5889 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm
