Newbie question
am 12.05.2006 20:14:51 von Chris StylesHi,
I'm learning MySQL, and I am struggling with a few odds and ends. The one
that I can't see how to crack is to search by age.
The records in my database have a datetime field for when they were
inserted.
In my web front end I want to do a "show me entries inserted during the last
[1-9] Days or [1-3] months"
I am guessing the query will be something like
Select * where Date > NOW () -
My PHP script can take account for if it is filtering in days or months, but
I cant work out the actual syntax for subtracting a set number of days or
months from NOW()
Any help gratefully accepted!
Thanks
Chris