is this

select distinct event_day from weekly_schedule order by event_day

your actual sql statement, or just a 'simplified' version for the 
mailing list?


Rick Faircloth 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.
>>
>>
>>
>>     
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

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

Reply via email to