What does it show when you run a cfdump on the query? <cfdump var="#get_days#" />
On 10/14/07, Rick Faircloth <[EMAIL PROTECTED]> wrote: > > @ All... > > This is just nuts... > > I can run this sql in an editor and get the correct results: > > select distinct event_day from weekly_schedule order by event_day > > And the correct results are 1, 2, 4, 6. > > But if I run that same sql in a CF8 cfquery, scoping or not scoping > every variable, all I get is 1, 1, 1, 1. This was working perfectly in CF > 4.5. > > <cfquery name="get_days" datasource="#dsn#"> > select distinct event_day from weekly_schedule order by > event_day > </cfquery> > > I even put just the query and output commands on a separate page > and still get 1, 1, 1, 1. > > <cfquery name="get_days" datasource="#dsn#"> > select distinct event_day from weekly_schedule order by > event_day > </cfquery> > > <cfloop query="get_days"> > <cfoutput>#get_days.event_day#</cfoutput><br /> > </cfloop> > > I just don't get it... > > Any more ideas, anyone? :o/ > > Rick > > > > > > -----Original Message----- > > From: Claude Schneegans [mailto:[EMAIL PROTECTED] > > Sent: Sunday, October 14, 2007 11:49 AM > > To: CF-Talk > > Subject: Re: Why would this query not return the correct data? > > > > <cfloop query="get_days"> > > <cfoutput>#event_days#</cfoutput> > > </cfloop> > > > > This is an old CF bug: > > Inside a loop, a column name alone always comes from the first record. > > You must specify the query name to get the current row: > > <cfloop query="get_days"> > > <cfoutput>#get_days.event_days#</cfoutput> > > </cfloop> > > > > -- > > _______________________________________ > > REUSE CODE! Use custom tags; > > See http://www.contentbox.com/claude/customtags/tagstore.cfm > > (Please send any spam to this address: [EMAIL PROTECTED]) > > Thanks. > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291054 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

