473,327 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

How to pick next or prevoius day?

Hi,
How can i pick next or prevoius day in mysql? Any function like next_day in Oracle ?
--Thanks
vasavivenu
Feb 25 '11 #1
3 3426
Atli
5,058 Expert 4TB
Try
Expand|Select|Wrap|Line Numbers
  1. SELECT DATE_ADD(NOW(), INTERVAL 1 DAY);
You can use the DAY() function with that to extract the day of the month.
Feb 25 '11 #2
Thanq sir, but i need "next_day('01-mar-2011','tue') in oracle" these functionality. means this query returns me 08-mar-2011 as the answer. So i need the replacement this function in mysql.

Thanks

vasavivenu
Feb 25 '11 #3
Rabbit
12,516 Expert Mod 8TB
You use the same function but you have to use a variable number for the amount of days you want to add. To do so, you could use an IF to return 1 if it's a Monday and 8 - Weekday() otherwise.

Or you can get tricky and use 8 - (Weekday + (7 - Weekday) \ 7 * 7. Where "\" is integer division.
Feb 25 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jason | last post by:
Is there a way to avoid On Error Resume Next for: cnn.Open strCon SQL = "EXEC Customer @txtEmail='" & email_address & "'" set rs = cnn.execute(SQL) 'On error resume next rs("email_address")...
1
by: Konrad | last post by:
Hi How to remove prevoius version of proram using VS .NET 2003 installer. If I set this option then installing from VS removes prevoius version. Installing from stand alone msi not? Thanks...
4
by: walterbyrd | last post by:
Let's suppose I have dozens, or hundreds of JPGs. I want to put them in photo album sort of format. With thumbnail and all. Do I have to specically spell out the full name of each file? Or is there...
4
by: Vincent Yang | last post by:
I'm using Access 2002. My database is in Access 2000 format. I'm designing a form to collect responses to a 40-item questionnaire. I can fit four list boxes on a screen, so I plan to have 11 tab...
4
by: anita | last post by:
I had posted this question before, but did not hear from anybody. Can somebody pls help me out. I am creating a table with two fields F1, F2 and F2 has about 50,000 randomly generated alphanumeric...
0
by: Tony | last post by:
vs 2002 - vb - access 2002 - xp - web forms I want to display records, one at a time. I have about 25 fields to display. I've created SQL and retrieved records. I placed data in 25 separate...
10
by: Mark Winter | last post by:
Hello, I am wondering if someone could point me in the right direction to figure out how to create a dynamic form. I have been developing programs in perl and oracle and have recently switched...
16
by: lak | last post by:
i know left and right shift normally,but i cant know what happens if it is negative. for example int x=-2; x<<=1;//what happens here
3
by: SM | last post by:
Hello, I have an array that holds images path of cd covers. The array looks like this: $cd = array( 589=>'sylver.jpg', 782=>'bigone.jpg', 158=>'dime.jpg' );
3
by: Pravs | last post by:
I have a database wherein a lot of fields are updated by my team on a daily basis. When they are working on a lot of rows of same patient and certain fields have to be filled with same data, to save...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.