Thanks for the hint there.
Yes the problem seems to be that CF creates the data types at run time and as far as I
can tell based on the first row of the query. So depending on wich recordset is passed
by the appendquery function, that particular column can change data types (in my case
the data type is ntext in SQL and basically can accept any data type) but when CF sees
mm/dd/yy it assumes it's a datetime data type, same thing with other data types as
well.
Just for the heck of it and based on a thread I read, I created this 'fix query'
method that forces the first row to be string but it still will not work. So I am
begining to think that saving the instance data on a Q of Q is not the best solution
here but I really want to group the data so I welcome any suggestions....
<cffunction name="fixquery"
returntype="query"
hint="Ugly fix to CF Bug. Takes a query and returns a new one
with a blank first row">
<cfargument name="Query" type="query" required="Yes">
<cfscript>
lstFields = arguments.query.Columnlist;
qTemp = QueryNew(lstFields);
QueryAddRow(qTemp,1);
</cfscript>
<cfloop index="ii" list="#lstFields#">
<cfscript>
QuerySetCell(qTemp,ii,'');
</cfscript>
</cfloop>
<cfloop query="arguments.Query">
<cfscript>
QueryAddRow(qTemp,1);
</cfscript>
<cfloop index="ii" list="#lstFields#">
<cfscript>
QuerySetCell(qTemp,ii,evaluate(ii));
</cfscript>
</cfloop>
</cfloop>
<cfreturn qTemp />
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4