DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   How to pick next or prevoius day? (http://www.daniweb.com/forums/thread136715.html)

veledrom Jul 25th, 2008 10:58 am
How to pick next or prevoius day?
 
Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks

tesuji Jul 25th, 2008 2:34 pm
Re: How to pick next or prevoius day?
 
Quote:

Originally Posted by veledrom (Post 656042)
Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks


next: today + 1
previous: today - 1

Shanti Chepuru Jul 26th, 2008 2:36 am
Re: How to pick next or prevoius day?
 
You can do it with DATEADD, directly in MySql

SELECT DATEADD(...) AS IncrementedDate from ...
DATEADD("2000-12-01",INTERVAL 1 DAY)

tesuji Jul 26th, 2008 10:13 am
Re: How to pick next or prevoius day?
 
hi velodrom

SELECT current_date() - INTERVAL 1 DAY AS "Help yesterday !",   
    current_date() + INTERVAL 1 DAY AS "for tomorrow never come !";

may also give some results.

krs, tesu

veledrom Jul 26th, 2008 6:05 pm
Re: How to pick next or prevoius day?
 
I'll try and let you know.
Thanks guys

veledrom Jul 27th, 2008 3:47 pm
Re: How to pick next or prevoius day?
 
Thank you guys. It works now. Tejusi, your solution is in use.


All times are GMT -4. The time now is 3:25 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC