I'd do the latter and still prefix the column with the query name.  But not
for any reason other than I just do it that way all the time after becoming
a scoping nazi due to a horrible project I overtook many years ago.

On 10/14/07, Maximilian Nyman <[EMAIL PROTECTED]> wrote:
>
> Considering that your doing a select distinct, the correct output
> should be 1, 2, 4, 6 and not 1, 1, 1, 1, 2, 4, 6 as you first stated.
>
> So it looks like you're getting the very first value 4 times. Try to
> scope the output and see if that helps:
> <cfloop query="get_days">
>        <cfoutput>#get_days.event_days#</cfoutput>
> </cfloop>
>
> Or better yet drop the <cfloop> all together and only use <cfoutput>
> <cfoutput query="get_days">#event_days#</cfoutput>
>
> /Max
>
>
> On 10/14/07, Rick Faircloth <[EMAIL PROTECTED]> wrote:
> > Follow-up:
> >
> > When I run the same query below in a query editor,
> > the correct data, 1, 2, 4, 6 is returned.
> >
> > What wouldn't CF 8 return the same data with the same query?
> >
> > Rick
> >
> >
> > > -----Original Message-----
> > > From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> > > Sent: Sunday, October 14, 2007 1:40 AM
> > > To: CF-Talk
> > > Subject: Why would this query not return the correct data?
> > >
> > > Hi, all.
> > >
> > > Here's the query:
> > >
> > > <cfquery name="get_days" datasource="#dsn#">
> > >
> > >       select distinct event_days from weekly schedule order by
> > > event_day
> > >
> > > </cfquery>
> > >
> > > The data that should be returned if the query is looped is
> > >
> > > 1, 1, 1, 1, 2, 4, 6
> > >
> > > However, when I run.
> > >
> > > <cfloop query="get_days">
> > >
> > >       <cfoutput>#event_days#</cfoutput>
> > >
> > > </cfloop>
> > >
> > > .. all I get is 1, 1, 1, 1.four ones, and that's it.
> > >
> > > What could I be doing wrong?  I knew transitioning from CF 4.5 to CF 8
> > > would present some issues, but gee whiz.
> > >
> > > Rick
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291040
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to