Skip to main content
Inspiring
April 5, 2007
Answered

Using Date functions to determine % of fiscal year completed

  • April 5, 2007
  • 1 reply
  • 573 views
I'm trying to figure out how I can use the date functions to determine the percentage of my organizations fiscal year that has been completed. For example our fiscal year starts October 1st and ends November 31st the following year. Based on the current date I would like to be able to determine what percentage of the fiscal year has been completed. I assume I can set variables for the start and end dates of the fiscal year and then use the date Now() function to determine the current date. Can I use the DateDiff() function to accomplish this task?
    This topic has been closed for replies.
    Correct answer dempster
    Calculate the number of days in the fiscal year and the number of days since the start of the fiscal year, and divide:

    <CFSET FYbegin = CreateDate(2006,10,1)>
    <CFSET FYend = CreateDate(2007,11,30)>
    <CFSET pctgone = DateDiff("d", FYbegin, now())/DateDiff("d", FYbegin, FYend)>

    I assume your dates are wrong, since there is no November 31 and your year is 14 months long.

    1 reply

    dempsterCorrect answer
    Inspiring
    April 5, 2007
    Calculate the number of days in the fiscal year and the number of days since the start of the fiscal year, and divide:

    <CFSET FYbegin = CreateDate(2006,10,1)>
    <CFSET FYend = CreateDate(2007,11,30)>
    <CFSET pctgone = DateDiff("d", FYbegin, now())/DateDiff("d", FYbegin, FYend)>

    I assume your dates are wrong, since there is no November 31 and your year is 14 months long.
    Inspiring
    April 6, 2007
    Thanks for the help. Yes, my dates were wrong. I should have had 10/1/2006 through 09/30/2007.