Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Sql Sqldate Mysql Date Minus Days

Related Tutorials


 
 

Share on Google+Share on Google+

Mysql Date Minus Days

Advertisement
The Tutorial cover on Mysql Date Minus Days return you the day after subtracting from current date.

Mysql Date Minus Days

     

The Tutorial cover on Mysql Date Minus Days return you the day after subtracting from current date.

Understand with Example

The Tutorial elaborate an example from Mysql Date Minus Days. To understand the example, we use the select date(now( )) Query that return the current date.

Query for viewing current date:-

mysql> select date (now());

Output:-

+--------------+
| date (now()) |
+--------------+
| 2008-12-20   |
+--------------+
1 row in set (0.00 sec)

 

Query for viewing date after subtracting 2 day from current date:-

The given below Query return you the date after subtracting 2 day from current date. 

mysql>  select date_sub(curdate(),interval 2 day)as Date;

Output:-

+------------+
| Date       |
+------------+
| 2008-12-18 |
+------------+
1 row in set (0.00 sec)
Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 20, 2009

Related Tutorials

Discuss: Mysql Date Minus Days  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com