That's the actual sql... a simple statement.

Now this is strange... I ran a little test.

I changed the event_day data directly in the database
from 1,1,1,3,4,6 or whatever it was and added one
to each digit and made the event_day data 2,2,2,4,5,7.

This data is in a MySQL db with a field type of tiny integer.
(I then convert this into a day_of_week using MySQL)

Anyway, when I run the same query in the MySQL editor, I get the
expected results, 2,4,5,7.

However, when I run the query via a cf page using...

        <cfquery name="get_days" datasource="his_anointing">
                select distinct event_day from weekly_schedule order by
event_day
        </cfquery>
                        
        <cfloop query="get_days">
        <cfoutput>#get_days.event_day#</cfoutput><br />
        </cfloop>

        <cfdump var="#get_days#">

....I still get 1,1,1,1 from both the looped output and the cfdump.

I even went back and changed the text color on the page to make sure I'm
running
the correct page in the browser.  It's the right one, because the text color
is now red.

I changed the database table data and changed one of the 2's to a 3 to see
if the
output and cfdump changed to make sure I'm running the query on the same
database in
both places... yep, now the output from the editor reads 2,3,4,5,7, but the
query output
and cfdump reads 1,1,1,1,1.  It just added another 1 to the original 4 1's.

So the 1's can't be representing the data; there are no 1's in the table
now.  It's as if
it's stuck on a rowcount of 1 or something; or perhaps...no it couldn't
be...a value of
1.  But that wouldn't make any sense.

Is it a variable type (tinyint) problem?
I don't see why a variable type of tinyint wouldn't work.  I just need to
store
numbers 1-7 to convert to a day of the week.  Which worked fine in MySQL 4.1
and CF 4.5.

???

Rick



> -----Original Message-----
> From: Azadi Saryev [mailto:[EMAIL PROTECTED]
> Sent: Sunday, October 14, 2007 10:17 PM
> To: CF-Talk
> Subject: Re: Why would this query not return the correct data?
> 
> 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?
> 
> 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291085
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