Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks

Recommended Answers

All 5 Replies

Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks

next: today + 1
previous: today - 1

You can do it with DATEADD, directly in MySql

SELECT DATEADD(...) AS IncrementedDate from ...
DATEADD("2000-12-01",INTERVAL 1 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

I'll try and let you know.
Thanks guys

Thank you guys. It works now. Tejusi, your solution is in use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.