Try writing your output with CFFile

First, create a new file with your first line being a tab delimited column
head names:


<cffile action="WRITE" file="C:/filepath/file.xls" output="Heading1
Heading2        Heading3" addnewline="Yes">


Next, append your query results, again, delimit with tabs -- you'll want to
surround your CFFile-append with a CFLoop query loop:

<cffile action="APPEND" file="C:/filepath/file.xls" output="#heading1column#
#heading2column#        #heading3column#" addnewline="Yes">

H.

=========================
Howard Owens
Web Producer
InsideVC.com
mailto:[EMAIL PROTECTED]
=========================

> -----Original Message-----
> From: Ray, James A [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 02, 2000 2:01 PM
> To:   [EMAIL PROTECTED]
> Subject:      CF to Excel
> 
> How can I take the results of a Query and save it as an Excel file?
> 
> This is what I though would work. 
> 
> Thanks all!
> 
> <CFQUERY NAME="DIMS" DATASOURCE="DSTS">
>       SELECT      END_ITEM_ROOT_PN, END_ITEM_SN 
>       FROM         DSTS.B_V_DSTS_ASSEMBLY 
>       ORDER BY  END_ITEM_ROOT_PN, END_ITEM_SN
> </CFQUERY>
> <cfcontent type="application/msexcel">
> 
> <CFOUTPUT QUERY="DIMS">#END_ITEM_ROOT_PN#     #END_ITEM_SN#</CFOUTPUT>
> 
> 
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to