This topic is locked

Custom search

4/16/2008 7:47:29 PM
PHPRunner General questions
F
Fawaz author

How can I create search filters (links) on ..._list.php based on date range?
For example,

  • All orders today
  • All orders this week
  • All orders this month
    Any hint?
    Thanks,

    Fawaz

Sergey Kornilov admin 4/17/2008

You can use BeforeSQL event and DATEDIFF function (if you use MySQL)
Examples:
All orders today:

select ... from ... where DateDiff(now(), DateField)<1
All orders last seven days:

select ... from ... where DateDiff(now(), DateField)<7
etc
More info:

http://dev.mysql.com/doc/refman/5.0/en/dat...nction_datediff