reports based on date...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gnawz
    New Member
    • Nov 2006
    • 64

    reports based on date...

    Hi developpers,
    I need to generate reports in three ways:

    I have a Date field in my database...

    today
    $query = 'SELECT * FROM 'table' WHERE Date = today';

    Past seven days
    $query = 'SELECT * FROM 'table' WHERE Date - 7';

    Choose month( drop down preferably)

    $query = 'SELECT * FROM 'table' WHERE Date = "'.$_POST['monthselected'].'"';

    Please help on how to do the SQLs based on date
  • dafodil
    Contributor
    • Jul 2007
    • 389

    #2
    Originally posted by gnawz
    Hi developpers,
    I need to generate reports in three ways:

    I have a Date field in my database...

    today
    $query = 'SELECT * FROM 'table' WHERE Date = today';

    Past seven days
    $query = 'SELECT * FROM 'table' WHERE Date - 7';

    Choose month( drop down preferably)

    $query = 'SELECT * FROM 'table' WHERE Date = "'.$_POST['monthselected'].'"';

    Please help on how to do the SQLs based on date
    You can use the functions in this link: http://dev.mysql.com/doc/refman/5.0/...functions.html


    There are also examples.
    Hope you'll learn a lot.

    If you got any questions feel free to post.

    Comment

    Working...