hi 2 all ,
i have a problem in search according time period,

my table name "stats" have field id(int), ip(var char), counter(int),add_date(date time)

now i want a search on following ways

1. i want to show sum of counter according weekly >>>means weekly stats of counter
2. i want to show sum of counter according month>>> monthly stats of counter
3. i want to show sum of counter according yearly>>> yearly stats of counter

8 Years
Discussion Span
Last Post by sanjaypandit

Is the weekly set to one week since now (7 days) or is it since last Sunday?
I assume monthly means for this calendar month
I assume yearly means this calendar month

Do you want stats for this timespan or a list of all weeks if 'weekly', all months if monthly, etc etc.

Check out the 'BETWEEN' keyword in the mysql manual.

Edited by diafol: n/a


weekly mean only limited to this week and last week

monthly means stats according months for last 12 months,
stats for dec, month, stats for jan month, stats for nov month,

for yearly,, stats for this year , stats from last year

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.