943,884 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Marked Solved
  • Views: 3125
  • MySQL RSS
Jul 25th, 2008
0

How to pick next or prevoius day?

Expand Post »
Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks
Reputation Points: 38
Solved Threads: 0
Master Poster
veledrom is offline Offline
724 posts
since Apr 2008
Jul 25th, 2008
0

Re: How to pick next or prevoius day?

Click to Expand / Collapse  Quote originally posted by veledrom ...
Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks

next: today + 1
previous: today - 1
Reputation Points: 158
Solved Threads: 98
Master Poster
tesuji is offline Offline
720 posts
since Apr 2008
Jul 26th, 2008
0

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)
Last edited by Shanti C; Jul 26th, 2008 at 2:41 am. Reason: add
Reputation Points: 137
Solved Threads: 162
Posting Virtuoso
Shanti C is offline Offline
1,641 posts
since Jul 2008
Jul 26th, 2008
0

Re: How to pick next or prevoius day?

hi velodrom

sql Syntax (Toggle Plain Text)
  1. SELECT CURRENT_DATE() - INTERVAL 1 DAY AS "Help yesterday !",
  2. CURRENT_DATE() + INTERVAL 1 DAY AS "for tomorrow never come !";

may also give some results.

krs, tesu
Last edited by peter_budo; Jul 26th, 2008 at 5:17 pm. Reason: Keep It Organized - please use [code] tags
Reputation Points: 158
Solved Threads: 98
Master Poster
tesuji is offline Offline
720 posts
since Apr 2008
Jul 26th, 2008
0

Re: How to pick next or prevoius day?

I'll try and let you know.
Thanks guys
Reputation Points: 38
Solved Threads: 0
Master Poster
veledrom is offline Offline
724 posts
since Apr 2008
Jul 27th, 2008
0

Re: How to pick next or prevoius day?

Thank you guys. It works now. Tejusi, your solution is in use.
Reputation Points: 38
Solved Threads: 0
Master Poster
veledrom is offline Offline
724 posts
since Apr 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Mysql Trigger error
Next Thread in MySQL Forum Timeline: Do you have trouble connecting to mysql database using the odbc mysql 5.1 driver





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC