Help on reports using dates

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

    Help on reports using dates

    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

    my dates are stored in mysql with field type DATETIME so they give date and time.
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Hi gnawz. Perhaps you couldn't find your other post or maybe you temporarily lost your way around the site. In any case, double posting of a question is one of the things that is discouraged on this site, as stated in our Posting Guidelines. Please take some time to become familiar with them. Thank you.

    Comment

    • dafodil
      Contributor
      • Jul 2007
      • 389

      #3
      Hey gnawz heres the link to your other post:

      Comment

      Working...