Skip to main content
Inspiring
June 12, 2009
Question

Date problem - check if start of month

  • June 12, 2009
  • 2 replies
  • 549 views

HI Folks,

I'm creating a basic counter, where hits are stored in a db, but I would like to dump the totals in a seperate table at the end of each month. So I can keep monthly hit stats.

Can anyone please tell me how I can tell if its the end of the month, and then dump the results for that month in a seperate table/ text file

Thankyou

    This topic has been closed for replies.

    2 replies

    Inspiring
    June 14, 2009

    Schedule a job to run on the 1st of each month.  You should always be able to figure out the previous month.

    Inspiring
    June 12, 2009

    Give this a try...

    <cfif dateFormat(now(), "dd") EQ daysinmonth(now())>
           end of month

    <cfelse>
           not end of month
    </cfif>

    tclaremont
    Inspiring
    June 12, 2009

    What is the purpose of creating separate tables? Why not leave the hits in the current table, and query the table for watever time period you want?