开发者

Grab 5 days forward

I am used to work with timestamps, I will attempt working with normal date 2011-02-02 12:00:00 format now

I have this:

SELECT * FROM users_calenders WHERE date ?

I would like to select everything where date is now to 5 days forward / in future

my date is in this format: 2011-08-26

So if 开发者_如何学JAVAit was the 21. 22. 23. 24. 25. 26. today, it should show it..

If it was the 20. it should not show it as then there is 6 days to 26. august


In MySQL:

SELECT  *
FROM    users_calendars
WHERE   date >= CURDATE()
        AND date < CURDATE() + INTERVAL 6 DAY
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜