I have an int field in my product table called product_stat
which is incremented everytime a product is looked at. I also have a date field called product_date_added
.
In order to figure out the average visits per day a product gets, you need to calculate how many days the product has existed by using the current date and the date the product was added. Then divide the product stat by the amount of days it has existed to get the average visits per day.
OK but what I want to do is select a number of products and order them by visits per day DESC
How can I do that?
Thanks!!!