Here. Convert query and filename as you like: <cfquery datasource="#application.ds#" name="test"> select branchid, branchname from tblbranches </cfquery>
<cfoutput query="test"> <cfset myvar = ""> <cfloop list="#test.columnlist#" index="mycol"> <cfset myvar = myvar &", "& evaluate("test." & mycol)> </cfloop> <cfset myvar = right(myvar, len(myvar) - 1)> <cffile action="APPEND" file="\\yvrworptest\worp\test.csv" output="#myvar#"> </cfoutput> -----Original Message----- From: Michael Tangorre [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:31 AM To: CF-Talk Subject: csv files Shoot me dead if this has been asked and answered, but pelase respond nonetheless so that my replacement can jump right in: what is the easiest way to create a csv file from a query? What I have is a custom tag that takes a runs a query and need to genenrate a csv file and then save it to the server using cffile. TIA, Mike ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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