You'll could do something like:

<cfquery name="rsFix" datasource="x">
        SELECT uid, theDate
        FROM    myTable
</cfquery>

<cfloop query="rsFix">
        <cfset newDate = "20" & listGetAt( rsFix.theData, 3, "-" ) & "-" & 
listGetAt( rsFix.theData, 1, "-" ) & "-" & listGetAt( rsFix.theData, 2, 
"-" )/>
        <cfquery datasource="x">
                UPDATE myTable
                SET theDate = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#theDate#"/>
                WHERE uid = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#rsFix.uid#"/>
        </cfquery>
</cfloop>

Of course I have just thought of that and not tested it at all... 
use/debug at your own will.

Once you've done this, you should be able to convert the data type too.

Good luck,
Ant

On 14 Dec 2004, at 16:27, Mike wrote:

> I'm willing to convert the column if I can find a way.  I'm running a
> 3.x version my MySQL and at the time an upgrade is out of the question
> since I don't have access to the machine..
>
> So maybe the question I should be asking is how can I convert:
> 10-22-04 to 2004-10-22
>
> I've been scratching my head trying to do this in coldfusion but I'm
> just spinning my wheels..  Still a bit of a noob..  :)
>
> -Mike
>
>
> On Tue, 14 Dec 2004 07:37:29 -0800, Rob <[EMAIL PROTECTED]> wrote:
>>
>> One way to hack this is to use the "old school date maneuver". Dates
>> will order correctly using text methods if they are in the format
>> yyyy-mm-dd. So if you can't find a way to convert that column (which I
>> highly recommend) you can do something like this (pseudo code)
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187560
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to