Web Analytics Made Easy -
StatCounter Date Problem - CodingForum

Announcement

Collapse
No announcement yet.

Date Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Date Problem

    Hi Guys

    Im having a Problem querying a date field in Mysql. I need to return all recs that are between the Current Date and the date field ,if the value date field is between 1 and seven days.

    I am using Mysql ver 4.0.

    Thanks

  • #2
    Welcome here!

    Do you mean you want to get all records with a datetime value that is not older then 7 days ? Like

    SELECT var1, var2 FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(yourdatetimevaluel) <= 7
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

    Comment

    Working...
    X