views:

49

answers:

1

Hello

This is a bit "confused" question for those who don't now advanced SQL...

However. I want your help to do a query. Its simple but I'm not sure how to do it.

I want the query to do something like this.

I want her to

SELECT * FROM table1 WHERE date....

The date condition its only to show items that have a date to the MAX of 15 days past the actual date. PS: The data column is a datetime type.

Does somebody now how can i accomplish this?

Thanks.

+2  A: 
SELECT t.* 
FROM   table1 t
where  DATE(t.mydate) <= DATE_ADD(CURRENT_DATE(), INTERVAL 15 DAY) 
ORDER BY t.mydate DESC;
Adam Bernier
Didn't workout..But never mind. I've use other way.Thanks any way.
Fábio Antunes
@KGTM: feel free to explain exactly what didn't work. Someone will probably be able to help you with that.
Adam Bernier
Never mind... I had to change some of the items.. Its was a tipping error.Thanks it worked.
Fábio Antunes