I've actually done something similar, with the variable being built from
database output.
Here's some of the code I used:
<!--- Create the variable to hold output string --->
<cfset txtoutput = "">
<!--- Filename --->
<cfset outfile = "C:\ACVNA\Users\Juditht\LUPAEpisodeRpt.txt">
<cfif FileExists(outfile)>
<cffile action="delete" file="#outfile#">
</cfif>
<cfset txtoutput='Name;Account;Episode Start;Episode End;Initial
HHRG;HIPPS;SN;PT;OT;ST;MSW;AIDE;Totals;SN Amt;PT Amt;OT Amt;ST Amt;MSW
Amt;AIDE Amt;Total Charges;SUP Charges;LUPA
Revenue;Contract.;Days;Expected Reimb.;RAP Date;RAP Amt;RAP Payments;RAP
Pmt Date;FB Date;FB Amount;FB Payments;FB Pmt Date;Calculated Episode
Payments;Actual Reimb.;Final HHRG;Weight'>
<cffile action="write" file="#outfile#" output="#txtoutput#"
addnewline="yes">
<cfloop query="PPSLUPA">
<cfset CalcEpiPmt = RAP_Pmts + FB_Pmts>
<!--- Calculated Episode Payments --->
<cfset Contractual = TotalCharges + SupplyCharges - CalcEpiPmt>
<cfset Days =
DateDiff("D",DateFormat(EpisodeStart,"MM/DD/YYYY"),DateFormat(EpisodeEnd,"MM/DD/YYYY")+1)>
<cfset txtoutput = '#PtName#;#AccountID#;#DateFormat(EpisodeStart,
"MM/DD/YYYY")#;#DateFormat(EpisodeEnd,
"MM/DD/YYYY")#;#InitialHHRG#;#HIPPSCode#;#NumberFormat(SNVisits)#;#NumberFormat(PTVisits)#;#NumberFormat(OTVisits)#;#NumberFormat(STVisits)#;#NumberFormat(MSWVisits)#;#NumberFormat(AIDEVisits)#;#NumberFormat(TotalVisits)#;#DollarFormat(SNAmt)#;#DollarFormat(PTAmt)#;#DollarFormat(OTAmt)#;#DollarFormat(STAmt)#;#DollarFormat(MSWAmt)#;#DollarFormat(AIDEAmt)#;#DollarFormat(TotalCharges)#;#DollarFormat(SupplyCharges)#;#DollarFormat(LUPA_Revenue)#;#DollarFormat(Contractual)#;#Days#;#DollarFormat(ExpectedReimb)#;#DateFormat(RAPDate,
"MM/DD/YYYY")#;#DollarFormat(RAPAmt)#;#DollarFormat(RAP_Pmts)#;#DateFormat(RAP_PmtDate,
"MM/DD/YYYY")#;#DateFormat(FBDate,
"MM/DD/YYYY")#;#DollarFormat(FBAmt)#;#DollarFormat(FB_Pmts)#;#DateFormat(FB_PmtDate,
"MM/DD/YYYY")#;#DollarFormat(CalcEpiPmt)#;#DollarFormat(ActualReimb)#;#FinalHHRG#;#Weight#'>
<cfif FileExists(outfile)>
<cffile action="append" file="#outfile#" output="#txtoutput#"
addnewline="yes">
</cfif>
</cfloop>
HTH,
Judith
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:696
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54