I have a page which allows the user to select a custom query and download a
CSV. The relevant code is:
<cfsetting enablecfoutputonly="yes">
<CFHEADER NAME="Content-Disposition" VALUE="attachment;
filename=#session.MM_Username##LSTimeFormat(Now(),'hhmmmss')#.csv">
<CFCONTENT TYPE="application/excel">
<cfoutput>#fieldlist##chr(13)#</cfoutput>
<cfoutput query="rsList">
<cfloop index="thisfield" list="#fieldlist#">
<cfset newfield=#rereplace(evaluate("#thisfield#"),
"#chr(13)##chr(10)#", "#chr(10)#", "all")#>#trim(rereplace("#newfield#",
",", " ", "all"))#,
</cfloop>#CHR(13)#
</cfoutput>
I want to be able to figure out if #thisfield# is a SQL date/time object so
I can output it as mm/dd/yyyy instead of
2006-02-11 00:00:00.0
For some reason some of my users get this and excel interprets the date
field as 00:00:00.0 instead of the date, unless you go in and manually
change the format.
Any ideas?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261395
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4