Skip to main content
Participant
March 28, 2008
Question

Setting up table to report by dates

  • March 28, 2008
  • 1 reply
  • 831 views
Need some direction on setting up a table so I can pull data from the last 30 days.

The way I have the table right now is every time print.cfm is viewed it adds 1 to the "views" field in the table. Then I can create charts on that value. I would also like to create a chart on how many times its been viewed for the last 30 days. Any help on directing me how to do this would be great.

Thanks
This topic has been closed for replies.

1 reply

Inspiring
March 28, 2008
kendevorak wrote:
> Need some direction on setting up a table so I can pull data from the last 30
> days.
>
> The way I have the table right now is every time print.cfm is viewed it adds 1
> to the "views" field in the table. Then I can create charts on that value. I
> would also like to create a chart on how many times its been viewed for the
> last 30 days. Any help on directing me how to do this would be great.
>
> Thanks
>

You will need to create more data for this type of reporting. Instead
of updating a field for a given template on how many times it is view.
You would create a record in this log table for each view recording the
template name, date, time and any other relevant statistics you care to
store.

Then for your reports you would query this table counting how many
records where created between a given set of dates or other views you
desire.

Note for a large, busy site this type of table can become massive. Plan
accordingly.
Participant
March 28, 2008
So I would need to create a second table that records the date and hits and join it to the existing table. If thats the case I can see where this table would get very large with records. If you have a 1,000 users this table could collect hundreds of thousands of records. Not sure how well mySQL would handle the data. Do you have any experience with this?