Take a look at this and see if it makes sense.
<CFSET CPY = 2500> <!--- Cost Per year --->
<CFSET CPM = CPY / 12> <!--- Cost Per month --->
<CFSET CycleStart = "03/01/2002"> <!--- Cycle Start Date --->
<CFSET CycleMonth = '12'> <!--- No. of Months in your cycle --->
<CFSET CycleEnd = DateFormat(DateAdd('m', CycleMonth, CycleStart),
"mm/dd/yyyy")> <!--- Cycle End Date --->
<CFSET today = DateFormat(NOW(), "mm/dd/yyyy")> <!--- Sign up date --->
<CFSET monthsLeft = DateDiff('m', today, CycleEnd)> <!--- Months to
pro-rate --->
<CFSET Charges = monthsLeft * CPM> <!--- Pro-rated charge Calculated --->
<!--- See the logic output --->
<CFOUTPUT>#CycleStart# - #CycleEnd# - #today# - #monthsLeft# -
#DollarFormat(Charges)#</CFOUTPUT>
Dave
----- Original Message -----
From: "Brad T Comer- Ameritech" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, April 12, 2002 8:54 AM
Subject: ??
Can anyone assist, I have a headache from this puppy!
Prorating a purchase:
X=Cost 2500 for a year OR 2500/12 *
DifferenceInMonthsFromEXPMonthandCurrentMonth
Exp date is 08/31/02
If i make a purchase today I should be charged the difference in months
times {X}
Thanks
BtC
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists