User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 426,810 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,924 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 408 | Replies: 5 | Solved
Reply
Join Date: Apr 2008
Posts: 196
Reputation: veledrom is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
veledrom veledrom is offline Offline
Junior Poster

How to pick next or prevoius day?

  #1  
Jul 25th, 2008
Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 295
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 41
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: How to pick next or prevoius day?

  #2  
Jul 25th, 2008
Originally Posted by veledrom View Post
Hi,
How can i pick next or prevoius day in mysql? Any function like curdate() ?
Thanks



next: today + 1
previous: today - 1
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
Reply With Quote  
Join Date: Jul 2008
Location: Sweet India
Posts: 828
Reputation: Shanti Chepuru is on a distinguished road 
Rep Power: 2
Solved Threads: 74
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Practically a Posting Shark

Re: How to pick next or prevoius day?

  #3  
Jul 26th, 2008
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 Chepuru : Jul 26th, 2008 at 1:41 am. Reason: add
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote  
Join Date: Apr 2008
Posts: 295
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 41
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: How to pick next or prevoius day?

  #4  
Jul 26th, 2008
hi velodrom

  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 4:17 pm. Reason: Keep It Organized - please use [code] tags
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
Reply With Quote  
Join Date: Apr 2008
Posts: 196
Reputation: veledrom is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
veledrom veledrom is offline Offline
Junior Poster

Re: How to pick next or prevoius day?

  #5  
Jul 26th, 2008
I'll try and let you know.
Thanks guys
Reply With Quote  
Join Date: Apr 2008
Posts: 196
Reputation: veledrom is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
veledrom veledrom is offline Offline
Junior Poster

Re: How to pick next or prevoius day?

  #6  
Jul 27th, 2008
Thank you guys. It works now. Tejusi, your solution is in use.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 7:56 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC