Mysql Date Minus Days

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


 
Ads

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)

Advertisements

Share on Google+Share on Google+

Mysql Date Minus Days

Posted on: January 20, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Mysql Date Minus Days  

Post your Comment


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

Ads

 

Ads